mobiata/twine — Issue #2: Encoding issue with Apple formatter
Author: austintaylor
Created: 2012-02-21 20:16:25+00:00
State: open

I get the following message when trying to run consume-string-file.

/Users/austin/.rvm/gems/ruby-1.9.3-p0/gems/twine-0.1.2/lib/twine/formatters/apple.rb:31:in `match': invalid byte sequence in UTF-8 (ArgumentError)
from /Users/austin/.rvm/gems/ruby-1.9.3-p0/gems/twine-0.1.2/lib/twine/formatters/apple.rb:31:in `block in read_file'
from /Users/austin/.rvm/gems/ruby-1.9.3-p0/gems/twine-0.1.2/lib/twine/formatters/apple.rb:29:in `open'
from /Users/austin/.rvm/gems/ruby-1.9.3-p0/gems/twine-0.1.2/lib/twine/formatters/apple.rb:29:in `read_file'
from /Users/austin/.rvm/gems/ruby-1.9.3-p0/gems/twine-0.1.2/lib/twine/runner.rb:113:in `read_write_string_file'
from /Users/austin/.rvm/gems/ruby-1.9.3-p0/gems/twine-0.1.2/lib/twine/runner.rb:78:in `consume_string_file'
from /Users/austin/.rvm/gems/ruby-1.9.3-p0/gems/twine-0.1.2/lib/twine/runner.rb:35:in `execute_command'
from /Users/austin/.rvm/gems/ruby-1.9.3-p0/gems/twine-0.1.2/lib/twine/runner.rb:20:in `run'
from /Users/austin/.rvm/gems/ruby-1.9.3-p0/gems/twine-0.1.2/lib/twine/runner.rb:13:in `run'
from /Users/austin/.rvm/gems/ruby-1.9.3-p0/gems/twine-0.1.2/bin/twine:4:in `'
from /Users/austin/.rvm/gems/ruby-1.9.3-p0/bin/twine:19:in `load'
from /Users/austin/.rvm/gems/ruby-1.9.3-p0/bin/twine:19:in `

'

I see in the source that you are trying to read the file with mode 'r:UTF-8'. This seemed a little strange to me because the latest Apple docs describe the strings file as being UTF-16. There are no special characters in the english strings file. I got this error running Ruby 1.9.3. It failed silently under Ruby 1.8.7.