node-ldapjs
node-ldapjs copied to clipboard
utf-8 encoding, foreign language (Spanish)
Hi!
The receiver terminal (That makes the ldap search) can't read or show utf-8 characters, in this case, the "Ñ".
When I print in console from the server.search() function I can see the string responses clearly, I can read correctly the data and the "Ñ". But not from the other terminal that receives the response.
How can I fix this?
I tried the library utf-8 enconding and decoding but doesn't work. Also tried setting the charset in the response, but it didn't work either.
Now also doing
Buffer.from(users[i].LASTNAME, 'base64').toString('utf-8')
And what it does is that it doesn't show the special character Ñ. So for example, the last name "Nuñez" will show as "Nuez".
How can it be shown as "Nuñez"? Is it because of the LDAP version itself?
I do not understand the issue. Is ldapjs returning an error?
Hi @jsumners ldapjs is returning incorrect strings when there are special characters in it.
Only when there is a special character, it transforms it to Base64 automatically.
Here in the server, it reads the string correctly, but it returns this other weird string
Are you able to provide a reproduction test case in our integration tests (on the next
branch)?
👋
On February 22, 2023, we released version 3 of this library. As a result, we are closing this issue/pull request.
Please see issue #839 for more information, including how to proceed if you feel this closure is in error.