dhl / erb2haml

Simple script to bulk covert ERB files in a Rails app to Haml
MIT License
193 stars 21 forks source link

Error on line 128: Invalid Windows-31J character #10

Open incheon opened 10 years ago

incheon commented 10 years ago

Hello.

I am Japanese user and when I run rake haml:convert_erbs, following errors are returned against some erb files.

Error on line 128: Invalid Windows-31J character "\xE6"

(error character is different for each case, such as "\xE6" or "\xE4")

I compiled some erb templates and partials including Japanese characters. But somehow some of them causes error and the others not.

Moreover some says that put a code Encoding.default_external = 'utf-8' to config.ru is efficient and the other says environmental variable LANG should be ja_JP.UTF-8. I've tried both of them but cannot see any improvement.

Could you guess why?

milankubin commented 8 years ago

It's a problem with the file's encoding itself. Take a look at http://mindspill.net/computing/linux-notes/determine-and-change-file-character-encoding/ will give you a good strategy to check the files encoding and change it accordingly.