-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad decoding for languages other than English #165
Comments
@Cyperwu Thanks for the report. Could you be so kind as to send us a sample input (subject) and payload that we can take a look at? Thanks! |
@Cyperwu I am guessing here that the subject is not ASCII, and likely it should be. While the payload can be anything, the NATS protocol must be ASCII. Can you confirm this is the case? |
@aricart No the subject is not ASCII. But the NATS documentation didn't specify any encoding is a "must use" in subjects. Oh, Sorry. I've seen it. |
@aricart tried to directly subscribe to a non-alphanumeric subject and received no message.
|
Perhaps an issue should be filed with gnatsd requesting support for UTF-8 topic names? If the NATS protocol requires that topics are ASCII-encoded then it seems like this is a non-issue for client libs. |
A reproducible example which makes it fail might be nice, tried out of curiosity and there does not seem to be an issue receiving the message when using non-ASCII characters in the protocol line either.
|
@isobit I agree. |
@wallyqs What if you try |
@Cyperwu that works for me locally too...
|
@wallyqs In my case it is |
I also get:
@Cyperwu what OS are you running in? |
That's odd. My machine is MacOS X El Capitan 10.11.5. @aricart |
v2 doesn't deal with any encoding messages are simply byte arrays. |
Hi!
In line
767
,var buf = client.inbound.toString('binary', 0, MAX_CONTROL_LINE_SIZE);
encoding error will occur when using other languages.
I tried change
'binary'
to'utf8'
in line767
and add a function getting binary length from utf8 string:Then change line
936
var psize = m[0].length;
tovar psize = byteLength(m[0])
, my problem seems solved.The text was updated successfully, but these errors were encountered: