8000 string output bug in format.abc.Writer · Issue #82 · HaxeFoundation/format · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
string output bug in format.abc.Writer #82
Open
@SmerkyG

Description

@SmerkyG

format.abc.Writer outputs the number of characters instead of the number of bytes when writing strings. This causes errors when outputting special characters. The following code fixes the problem:

class ABCWriter extends format.abc.Writer {
	override function writeString( s : String ) {		
		var encoding = null;
		#if neko
		var b = untyped new Bytes(s.length,s.__s);
		#else
		var b = Bytes.ofString(s, encoding);
		#end
		writeInt(b.length);
		o.writeFullBytes(b,0,b.length);
	}	
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0