Bugs: Browse | Submit New | Admin

[#29645] Fixes for: Char encode error & Dir::WINDOWS error

Date:
2012-09-18 18:17
Priority:
3
Submitted By:
Harrison Uhl (harriso_uhl)
Assigned To:
Nobody (None)
Category:
win32-shortcut
State:
Open
Summary:
Fixes for: Char encode error & Dir::WINDOWS error

Detailed description
Using Ruby 1.9.3 on Windows Vista

In trying example_shortcut.rb I kept getting Encoding errors.  I got past this by adding .encode("UTF-8")
to Dir::DESKTOP  and  Dir::WINDOWS
 e.g. Dir::WINDOWS.encode("UTF-8")

I also found that the line:
   s.path = "c:\\" << Dir::WINDOWS.encode("UTF-8") << "\\notepad.exe"

added an extra c:\ at the start of the string -- which caused a 'method not found' error in the underlying shortcut.rb
line 138.  Removing the extra c:\ got rid of the problem.  (I don't know if the extra c:\ is present for older Ruby
or Windows.)

With the above changes I was able to create a shortcut.

If my fixes are appropriate, could someone please add them to the code base.

Thanks

Harrison

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item