-
Notifications
You must be signed in to change notification settings - Fork 281
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to convert from utf-8 to ISO-8859-8 ? #43
Comments
When you work with text data in javascript, you usually work in the following steps:
So, in your case I assume that the Second step, where you're converting it to an iso-8859-8 Buffer, is good. The last line ( After conversion to something other than native js strings, you should work with Buffers, not trying to convert it back. Usually you'll need some concatenation, use |
I need to send the <?xml version='1.0' encoding='ISO-8859-8'?> I am doing it with request node module. So are you saying that I need to feed response body with Buffer instead of string ? I'm not sure it's possible Thanks ! |
Why not? xmlStr = "<?xml version='1.0' encoding='ISO-8859-8'?>" + originalXmlStr;
buf = iconv.encode(xmlStr, 'iso-8859-8');
request({
url: "..",
method: "POST",
body: buf,
...
}, function(err, res, body) {
// do something.
}); The thing is, with |
From request documentation:
|
I wasn't aware of this :) Thanks a lot ! |
Hi, I am trying to convert a string in
utf-8
to a string iniso-8859-8
. I am doing this:Is this the right way of using your lib ?
Thanks 馃憤
The text was updated successfully, but these errors were encountered: