Skip to content
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

UTF-8 encoding fix. #44

Closed
wants to merge 1 commit into from
Closed

UTF-8 encoding fix. #44

wants to merge 1 commit into from

Conversation

krogebry
Copy link

I was having an issue where the AD server was sending back bad utf-8 code ( \x82 I believe was the code value ). I'm currently using this fix in a production scenario. I would love to get some feedback on if this is a valid fix.

@Ajedi32
Copy link

Ajedi32 commented Jul 20, 2012

I believe I'm having this same issue in my application:

C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/net-ldap-0.3.1/lib/net/ber/core_ext/string.rb:23:in `encode': "\x82" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/net-ldap-0.3.1/lib/net/ber/core_ext/string.rb:23:in `raw_utf8_encoded'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/net-ldap-0.3.1/lib/net/ber/core_ext/string.rb:15:in `to_ber'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/net-ldap-0.3.1/lib/net/ldap.rb:1396:in `block in search'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/net-ldap-0.3.1/lib/net/ldap.rb:1367:in `loop'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/net-ldap-0.3.1/lib/net/ldap.rb:1367:in `search'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/net-ldap-0.3.1/lib/net/ldap.rb:637:in `search'
        from ldap_test.rb:13:in `<main>'

I'll try your fix and let you know if it works for me.

Update: It worked, great fix! (+1) I'm still pretty new to Ruby so I can't say for sure whether or not what you did is the best way to fix the problem, but your commit definitely does the job. This bug was basically making net-ldap unusable for me, so I think it would be a good idea to pull this commit ASAP.

@psy-q
Copy link

psy-q commented Aug 20, 2012

I second that, we have the same issues with Microsoft products and would be grateful for a fix.

@miks
Copy link

miks commented Aug 28, 2012

This solves also our problems with Microsoft products. Please merge this, so we can use this without manual patching.

@DougHall
Copy link

I finally gave up waiting for this bug fix and just installed the net-ldap-1 gem, instead. Works like a charm. How about keeping the official branch up-to-date please.

@RoryO
Copy link
Contributor

RoryO commented Aug 28, 2012

Merged all the back pull requests and I'll push out a 0.4 tonight

Rory O'Connell
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Tuesday, August 28, 2012 at 12:08 PM, Doug Hall wrote:

Yea, I finally gave up waiting for this bug fix and just installed the net-ldap-1 gem, instead. Works like a charm. How about keeping the official branch up-to-date please.


Reply to this email directly or view it on GitHub (#44 (comment)).

@virgilm
Copy link

virgilm commented Sep 17, 2012

Uh, no 0.4? This was 20 days ago...

@adimitri
Copy link

@RoryO - I was bit by this bug too. Was wondering if you could push out the 0.4 soon? Thanks!

@PhilT
Copy link

PhilT commented Sep 27, 2012

Would like to see a new release for this too. Cheers.

@normelton
Copy link

Agreed here!

@schaary
Copy link
Member

schaary commented Oct 5, 2012

A new release would be fine. The utf-8 bug is very annoying.

@cthulhu666
Copy link

Not sure if it's the best way to fix the problem, but at least it makes net-ldap usable for me.

@darksoul42
Copy link

Just stumbled upon this bug while setting up Redmine... New release would be highly appreciated ;(

@alik78
Copy link

alik78 commented Nov 10, 2012

I got that code update manually into my local gem lib. So now instead of of error I get nil returned :
Not quite what I was going for... I am trying to list all groups in AD

filter = Net::LDAP::Filter.eq("objectclass", "group")
groups = ldap.search(:base => base, :filter => filter)
=> nil
Any thoughts on what I could be doing wrong here?
Thanks!

@ghost
Copy link

ghost commented Dec 5, 2012

+1 for a new release. This is really annoying.

@kevincodux
Copy link

Why is this still not pulled?

@ghost
Copy link

ghost commented Dec 5, 2012

The issue itself should be fixed in the current master branch (at least I didn't experience any issues with it) and you can reference it via your Gemfile like this:

gem "net-ldap", :git => "git://github.com/ruby-ldap/ruby-net-ldap.git", :branch => "master"

But it would be nice if the gem on rubygems.org would have been updated. Sadly this project seems a bit abandoned.

@kevincodux
Copy link

Weird; if it was merged with master, Github should say so. Thanks anyway.

@ghost
Copy link

ghost commented Dec 5, 2012

As you can see on https://github.com/ruby-ldap/ruby-net-ldap/commits/master/lib/net/ber/core_ext/string.rb there already was some code merging which should have fixed this issue.

So normally this pull request here could be closed. The issue really is that the gem hasn't been updated and people are thus coming to this repo to complain about code issues for whom fixes already could and should have been "shipped".

@chuckbjones
Copy link

It looks like this pull request is a duplicate of #41, which was pulled and is now closed. Not exactly the same code change, but solves the same problem.

@erniebrodeur
Copy link

:shipit:

@tschreier
Copy link

I am out of the office until 11.02.2013.Meine E-Mails werden nicht gelesen oder weitergeleitet.Gerne werde ich nach meiner Rückkehr Ihre Nachricht beantworten.In dringenden Fällen erreichen Sie uns unter info@iq-gmbh.com oder Tel. 0049 5031 9408-0.Vielen herzlichen Dank.Note: This is an automated response to your message "Re: [ruby-net-ldap] UTF-8 encoding fix. (#44)" sent on 06.02.2013 20:24:10. This is the only notification you will receive while this person is away.
i.Q. Gesellschaft für individuelle Qualitätssicherung mbH
Kirschenkamp 3
D-30926 Seelze
Geschäftsführer: Thomas Schreier
Amtsgericht Hannover HRB 110570
Umsatzsteuer-ID: DE173555521

@djscruggs
Copy link

This is still an issue two years later. Fortunately I was able to fix it using the gemfile change suggested by sebi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet