Bugs item #27327, was opened at 2009-10-21 15:20 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=575&aid=27327&group_id=126
Category: #gem and #require methods Group: v1.3.x Status: Open Resolution: None Priority: 3 Submitted By: Vít Ondruch (voxik) Assigned to: Nobody (None) Summary: RubyGems does not work properly with upcomming Ruby 1.9.2 Initial Comment: With ruby ruby 1.9.2dev (2009-10-07) [i386-mswin32_90], coming from win32-unicode-test branch, RubyGems does not work properly anymore. The problem is in initialization of system_config_path variable. The original code is: system_config_path = begin require 'Win32API' CSIDL_COMMON_APPDATA = 0x0023 path = 0.chr * 260 SHGetFolderPath = Win32API.new 'shell32', 'SHGetFolderPath', 'PLPLP', 'L', :stdcall SHGetFolderPath.call nil, CSIDL_COMMON_APPDATA, nil, 1, path path.strip rescue LoadError '/etc' end but it should be replaced by the following version: system_config_path = begin require 'Win32API' CSIDL_COMMON_APPDATA = 0x0023 path = 0.chr * 260 SHGetFolderPath = Win32API.new 'shell32', 'SHGetFolderPathW', 'PLPLP', 'L', :stdcall SHGetFolderPath.call nil, CSIDL_COMMON_APPDATA, nil, 1, path path.force_encoding('UTF-16LE').encode!('UTF-8') path.strip rescue LoadError '/etc' end i.e. the wide version of SHGetFolderPath should be used. However this code should be probably specific for specific Ruby versions. The problem can be reproduced for example on czech windows XP, where the method SHGetFolderPath returns following string: "c:\Documents and Settings\All Users\Data aplikací" ("c:\Documents and Settings\All Users\Application data" in EN windows), with US-ASCII encoding, which is completely wrong. ---------------------------------------------------------------------- Comment By: Nikolai Weibull (pcp) Date: 2009-10-21 18:52 Message: Also, use dl instead of Win32API, as Win32API is deprecated. And Luis, why not have one case for 1.8 and one for 1.9 here? ---------------------------------------------------------------------- Comment By: Luis Lavena (luislavena) Date: 2009-10-21 16:52 Message: You're correct. We can't implement Wide characters API as Ruby 1.8 do not support encoding in the same way 1.9 does. A workaround will be use Win32API completely for the encoding translation, but I'm having hard time finding that right now. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=575&aid=27327&group_id=126 _______________________________________________ Rubygems-developers mailing list http://rubyforge.org/projects/rubygems Rubygems-developers@rubyforge.org http://rubyforge.org/mailman/listinfo/rubygems-developers