[Win32utils-devel] win32-security, 1.9.x, encoding issue?

Daniel Berger djberg96 at gmail.com
Sun Aug 2 09:33:02 EDT 2009


Hi,

Windows Vista Home Premium
ruby 1.9.2dev (2009-07-18 trunk 24186) [i386-mswin32_90]

I noticed there was an ordinal bug in win32-security and Ruby 1.9.x. I fixed
those easily enough, but now we're left with this:

  1) Error:
test_string_to_sid(TC_Win32_Security_Sid):
ArgumentError: invalid byte sequence in US-ASCII
 
c:/Users/djberge/workspace/win32-security/lib/win32/security/sid.rb:111:in
`strip'
 
c:/Users/djberge/workspace/win32-security/lib/win32/security/sid.rb:111:in
`string_to_sid'
    test/test_sid.rb:62:in `test_string_to_sid'

Where line 111 is the last line of this:

def self.string_to_sid(string)
   sid_buf = 0.chr * 80
   string_addr = [string].pack('p*').unpack('L')[0]

   unless ConvertStringSidToSid(string_addr, sid_buf)
      raise Error, get_last_error
   end

   sid_buf.strip
end

I searched on the web but I wasn't really sure what the best or correct
solution was. I really hope we don't have to mess around with file
encodings.

Regards,

Dan



More information about the win32utils-devel mailing list