0

I have a ruby on Rails application that has problems with utf-8 and us-ascii ...

some of my files are utf-8 and other ascii ...

is there a smart way to convert all ascii files in utf-8 files?

Felix
  • 5,452
  • 12
  • 68
  • 163
  • You can use notepad++ follow this topic http://stackoverflow.com/questions/7256049/notepad-converting-ansi-encoded-file-to-utf-8 – thienkhoi tran Apr 01 '15 at 09:37
  • 1
    if they are actually plain ascii (and not the horribly named ascii-8bit name that ruby gives to binary files) then there is no converting to do - ascii is a strict subset of utf-8. If not then more details would be helpful – Frederick Cheung Apr 01 '15 at 10:13
  • if I check it with linux i got this: `./app/views/super_admin/log.html.erb -- text/plain; charset=us-ascii` ... I have some problems with my application: `incompatible character encodings: UTF-8 and ASCII-8BIT` and I thought it comes from the wrong encoding of the files? – Felix Apr 01 '15 at 10:14
  • You're going to have to narrow things down a little. For example the template could be fine but maybe you have a `<%=` tag that is trying to insert binary data into it. – Frederick Cheung Apr 01 '15 at 12:19
  • Also knowing what ruby / rails versions you are using would be useful – Frederick Cheung Apr 01 '15 at 12:21
  • I'm running ruby 1.9 and rails 3.2.12 and i want to use this: `<%= select_date() %>` – Felix Apr 01 '15 at 12:30
  • I've installed ruby 2.0.0 -> same problem – Felix Apr 01 '15 at 16:22
  • have you more informations about: `maybe you have a <%= tag that is trying to insert binary data into it` – Felix Apr 02 '15 at 11:27

0 Answers0