Skip to content

Econv behaviour for gb18030 #39

@LillianZ

Description

@LillianZ

Should the last two lines should be equal? Thanks!

EConv econv = TranscoderDB.open("UTF-8", "gb18030", 0);

byte[] src = "Lašas".getBytes("UTF-8");
byte[] dest = new byte["Lašas".getBytes("gb18030").length];

econv.convert(src, new Ptr(0), 6, dest, new Ptr(0), dest.length, 0);
System.out.println(Arrays.toString(dest)); 
// [76, 97, -127, 48, 18, 56, 97, 115]
System.out.println(Arrays.toString("Lašas".getBytes("gb18030"))); 
// [76, 97, -127, 48, -108, 56, 97, 115]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions