top | item 44926223

(no title)

mikojan | 6 months ago

> > Java, C# and JS use UTF-16-like encoding for in-memory string

>

> That’s incorrect for Java,

Maybe so, technically, but if you Base64 encode a string in a language that uses UTF-8 (or another UTF-16 with another endian) and decode it in Java, Java's UTF-16 representation will be the problem you will be dealing with.

discuss

order

kelnos|6 months ago

That's why when you are constructing a String with a byte array, you always, always, always use the constructor that also takes a character set.