Skip to content

utf8.EncodeRune is broken. #425

@gopherbot

Description

@gopherbot

by helmwo:

func EncodeRune(rune int, p []byte) int { 
        if rune <= _Rune1Max { 
                p[0] = byte(rune); 
                return 1; 
        } 

.... 

means that negative rune ints are encoded as such and converted to 
byte. This means I could get a $FF char from this. This is not correct 
imho.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions