Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

UCS2 big endian encoding for buffer #1684

Closed
farhadi opened this Issue · 4 comments

4 participants

Ali Farhadi Ben Noordhuis Damianos Mylonakis Koichi Kobayashi
Ali Farhadi

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)

Ben Noordhuis

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

Ben Noordhuis bnoordhuis closed this
Damianos Mylonakis

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'.

Ben Noordhuis

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

Koichi Kobayashi
Owner

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.