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
The Umlaut problem: UTF-8 chars get converted to unicode entities #20
Comments
I'm not super familiar with UTF-8 in general, so I'm not sure I can fix this myself. I've found some notes about doing a File.open to write as utf-8, but it seems to be Ruby 1.9 specific. |
Hm, I’m using Ruby 1.9 and UTF-8 in my summary field and both the gemspec file and the resulting gem’s metadata contain the proper UTF-8 strings – i.e., this bug does not manifest itself in my case. Markus: I tried your name in my gem and it worked. Did you specify the right Ruby file encoding (my Rakefile’s first line is ‘# encoding: UTF-8’)? |
BTW: \303\274 is the proper binary representation of UTF-8 ü:
|
It would make sense for the generated Rakefile to add |
It probably writes like that under 1.8 because it looks like it uses .inspect to dump the string back out. 1.8 isn't aware about UTF-8, it just sees special chars and escapes them. 1.9 is more intelligent about UTF-8 so it'll output as expected. |
To fix this if you apply the following string: |
sorry just realised SFEley also wrote this. +1 on this working :-) |
Just sent a pull request that adds the magic comment on top of Rakefile. #165 The original decoded UTF-8 problem still remains though. I guess this is a Rubygems' problem. |
I've merged in amatsuda's change. It adds Between that, and generated gemspects including |
In 1.8 you might be able to cure the 1.8 difficulties with:
Just a thought. |
When using an UTF-8 character (like the german umlaut ü) in the Rakefile, it gets converted to (2!) UTF-8 entities it seems.
For example in Rakefile it reads:
gem.authors = ["Markus Hüberman"]
And in the resulting gemspec file after releasing it gets converted to:
s.authors = ["Markus H\303\274berman"]
The text was updated successfully, but these errors were encountered: