Ruby 1.9, YAML & encodings

F

F. Senault

Hello all.

I'm trying to migrate a project to ruby 1.9.

I have a lot of source, ressource, and data files, all encoded in
ISO8859-1(5), so I'm trying to preserve this.

The trouble is that YAML seems to load every string file that contains a
non ASCII char with an encoding of "ASCII-8BIT" ; if I understand
correctly, it should follow the Encoding.default_external value.

A small example session :

13:20 fred@balvenie:~/ruby/blackops> ruby19 -v
ruby 1.9.0 (2008-07-25 revision 18217) [i386-freebsd6]
13:20 fred@balvenie:~/ruby/blackops> irb19ArgumentError: append incompatible encoding strings: ASCII-8BIT and ISO-8859-15
from (irb):62
from /usr/local/lib/ruby/1.9/irb.rb:149:in `block (2 levels) in eval_input'
from /usr/local/lib/ruby/1.9/irb.rb:262:in `signal_status'
from /usr/local/lib/ruby/1.9/irb.rb:146:in `block in eval_input'
from /usr/local/lib/ruby/1.9/irb.rb:145:in `eval_input'
from /usr/local/lib/ruby/1.9/irb.rb:69:in `block in start'
from /usr/local/lib/ruby/1.9/irb.rb:68:in `catch'
from /usr/local/lib/ruby/1.9/irb.rb:68:in `start'
=> "éééé"

Any ideas ?

(Nota : this is a hand compiled 1.9.0-3 version under FreeBSD, but it
does the same with the official ports version, 1.9.0-1.)
Fred
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Ruby 1.9 named arguments 5
each, stuck up... 2
Ruby 1.9.0 and the debugger 3
:IRB Bug 1
Ruby 1.9.0 and Mechanize 0
Bug in IRB 3
Strange bug in irb1.9 7
Problem on an example from ruby-lang.org 1

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top