Newbie question: Working with iso-8859-1 files in Ruby

Hi!

I am trying to load and parse text files with various encodings. Some
are iso-8859-1, some are pure ASCII and others utf-8. None of them
contain characters not available in iso-8859-1. What is a good
strategy to use when working with the standard string methods in Ruby
on these files? Upcase, for example, seems to ignore higher order
characters in iso-8859-1.

In irb:

s = “hellö”
s.upcase == “HELLÖ”
=> false

Kind regards,

Peter

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs