-
Notifications
You must be signed in to change notification settings - Fork 253
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
Complete support for UTF-8 #4
Comments
We're using this Gem and the names of the users have unwanted characters, when we should have Latin characters. I guess this is due to the UTF-8 / ASCII-8 conversion. Is there a workaround for this? Thanks. |
Could you give an example on what's actually in the LDAP server, and the incorrect string that's getting returned? |
Hi, Thanks you for your time. For example, in the LDAP server I have "Inês Gonçalves" and I get "In\xC3\xAAs Gon\xC3\xA7alves". |
We also encountered this issue. As a workaround: the gem seems to be returning valid UTF-8 text, just in the wrong encoding -- i.e., using force_encoding("UTF-8") on the results returned from LDAP will yield properly encoded text (I've been testing this with Japanese text). (Ironically, plain ASCII text will be encoded in UTF-8 already, so the force_encoding shouldn't cause issues where there already wasn't one.) |
Thanks! It works. |
I've also seen this now. Doing like this:
...works, but it's incredibly ugly to have to force encoding like that. Without it, it "works" for users with ASCII (7-bit) safe names, but users with e.g. scandinavian umlauts (åäö) get problems. ( Is there a plan to resolve this proper in |
Get the same result on ruby 2.1.6, net-ldap 0.11, windows 8.1 x64 ldap returned string "Frédéric" in ASCII-8BIT and I compared it with "Frédéric" in UTF-8 and it matched never..... Any progress to resolve this is welcome ! |
@RoryO - care to provide some more details on why this was closed? Has this been fixed, and if so, in what PR? |
I encountered the same problem on version 0.12.0. For those interested, this bug was fixed directly in Redmine : |
I am having the same issue regarding underscores... |
Internally we're still assuming ASCII-8 on all string, so when doing manipulations between a UTF-8 response from the server and internal strings it will fail with EncodingError on 1.9.
This is likely going to be a huge overhaul and should be a release in itself.
The text was updated successfully, but these errors were encountered: