ckruse / CFPropertyList

Read, write and manipulate both binary and XML property lists as defined by apple
MIT License
212 stars 47 forks source link

invalid byte sequence in UTF-8 #43

Closed cthomaschase closed 9 years ago

cthomaschase commented 9 years ago

Hi,

I'm getting the following when running the library via xcodebuild -exportArchive process, via the ipatool.

2015-10-02 21:16:25 +0000  warning: Configuration issue: platform iPhoneOS.platform doesn't have a 'iPhoneOS9.0.sdk' SDK with a SDKSettings.plist; ignoring it. Exception: #<ArgumentError: invalid byte sequence in UTF-8>
    /Users/slatebuilder/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/CFPropertyList-2.3.1/lib/cfpropertylist/rbPlainCFPropertyList.rb:43:in `skip'
    /Users/slatebuilder/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/CFPropertyList-2.3.1/lib/cfpropertylist/rbPlainCFPropertyList.rb:43:in `skip_whitespaces'
    /Users/slatebuilder/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/CFPropertyList-2.3.1/lib/cfpropertylist/rbPlainCFPropertyList.rb:177:in `import_plain'
    /Users/slatebuilder/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/CFPropertyList-2.3.1/lib/cfpropertylist/rbPlainCFPropertyList.rb:24:in `load'
    /Users/slatebuilder/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/CFPropertyList-2.3.1/lib/cfpropertylist/rbCFPropertyList.rb:313:in `load_str'
    /Users/slatebuilder/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/CFPropertyList-2.3.1/lib/cfpropertylist/rbCFPropertyList.rb:299:in `load_binary_str'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:292:in `LoadPlist'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2009:in `block in allKnownPlatforms'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1993:in `each'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1993:in `allKnownPlatforms'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2108:in `<main>'```

Any thoughts on what might be causing this?
ckruse commented 9 years ago

Can you check what your shell locale is? I suspect that you are using El Capitan, and they changed the locale to LC_ALL=C; thus the ruby interpreter seems to think that the files are coded as ASCII or Latin1 or something like that. An export LC_ALL=en_US.UTF_8 (or something similiar) should help.

cthomaschase commented 9 years ago

Thanks. Locale looks to be correctly set (before I make any changes):

LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL=

If I export LC_ALL=en_US.UTF-8 and run again it has the same result as above. Weird.

ckruse commented 9 years ago

Hm. Interesting. I had a very nasty typo in my code; I released a new version. Can you update the gem and retry?

cthomaschase commented 9 years ago

voila. thank you!