R
renoX
Hello,
I'm a newbie in Ruby and I have a problem with character encoding.
I use Ruby to list the file contained in a directory in Windows.
Those filenames contains non-ASCII character (French accent,etc)..
I'd like to put the name of those file in an XHTML webpage.
I have two possibilitties:
- I transcode from the 'native Windows encoding' to UTF-8.
or - I declare in the XHTML file to be in the encoding used by Ruby on
Windows.
My preferred solution would be do the transcoding, but I don't know what is
the encoding returned by Dir.each...
What does people do in Ruby to do the transcoding?
Or if the transcoding is too complicated to do, how do I find the encoding
corresponding to the localisation (French)so that my webpage shows the
accent correctly?
Google and online-documentation weren't helpfull, which I find strange
because this problem must be quite common..
I'm currently using ruby 1.6.8, but I can upgrade to a newer version if
needed
Thanks for your help, and have a nice day.
Renox.
I'm a newbie in Ruby and I have a problem with character encoding.
I use Ruby to list the file contained in a directory in Windows.
Those filenames contains non-ASCII character (French accent,etc)..
I'd like to put the name of those file in an XHTML webpage.
I have two possibilitties:
- I transcode from the 'native Windows encoding' to UTF-8.
or - I declare in the XHTML file to be in the encoding used by Ruby on
Windows.
My preferred solution would be do the transcoding, but I don't know what is
the encoding returned by Dir.each...
What does people do in Ruby to do the transcoding?
Or if the transcoding is too complicated to do, how do I find the encoding
corresponding to the localisation (French)so that my webpage shows the
accent correctly?
Google and online-documentation weren't helpfull, which I find strange
because this problem must be quite common..
I'm currently using ruby 1.6.8, but I can upgrade to a newer version if
needed
Thanks for your help, and have a nice day.
Renox.