UCS2 big endian encoding for buffer #1684

Closed
farhadi opened this Issue Sep 11, 2011 · 4 comments

Projects

None yet

4 participants

farhadi commented Sep 11, 2011

Buffer doesn't support UCS2-BE encoding.

I was going to write a patch for it, but I saw that this part is written in C and I'm not a C programmer.

It would be great to have this encoding in the core. It's a widely used encoding (e.g. SMPP protocol uses ucs2-be to encode unicode messages)

Owner

No, sorry. If we say yes to this, we'll have to say yes to the myriad other encodings too.

Have a look at https://github.com/bnoordhuis/node-iconv

@bnoordhuis bnoordhuis closed this Sep 12, 2011
razorg commented Oct 19, 2011

I need this issue solved also, because of minecraft protocol requiring ucs2 big endian encoded strings.
If i write a patch and submit it, you're ok with it? It can be another encoding option: 'ucs2-be'.

Owner

@razorg: Sorry but no, for the reason mentioned above.

koichik commented Oct 20, 2011

@razorg - Because v8 supports only little endian for UCS2, it is necessary to change byte order before reading and after writing a string from/to a buffer. It is possible in the user land. This is the reason why Node core does not support UCS2-BE.

@deathcap deathcap referenced this issue in PrismarineJS/node-minecraft-protocol Jan 31, 2016
Merged

Server response to legacy ping (fe and fe01) packets #334

@deathcap deathcap added a commit to deathcap/node-minecraft-protocol that referenced this issue Jan 31, 2016
@deathcap deathcap Use endian-toggle for UTF-16BE encoding (not in nodejs, see nodejs/no… 4a677a2
@nraynaud nraynaud referenced this issue in natevw/struct-fu Sep 28, 2016
Merged

add char16be #6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment