Ruby 1.9: invalid multibyte char (US-ASCII)

If you ever get an error like this:

invalid multibyte char (US-ASCII)

when running a ruby script with ruby 1.9 containing non ASCII chars like ‘ä’, ‘ü’, ‘ö’ etc changes are good that you forgot to add a

# coding: utf-8

statement at the beginning of the file.

About these ads

4 thoughts on “Ruby 1.9: invalid multibyte char (US-ASCII)

  1. why is it coding: utf-8 and not encoding ?? I tried with encoding which seems to be the convention but it didn’t work..

    regards
    Martijn

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s