HELP!Encoding Problem when Embedding Ruby

When I Embedding ruby, the encoding list only have 3 items:US-ASCII
UTF-8 ASCII-8BIT.
My computer’s code page is GBK(for example). And when I run the
interpreter to load a file whose name contains non-ASCII characters,
an exception ‘ConverterNotFound’ is raised. It says can’t translate
from ASCII-8BIT to UTF-8.
I have no idea about what it has done, raising such an exception.

But if I force the file’s name to be encoded by UTF-8, ruby can’t find
the file. Because ruby does not support unicode internally?
To implement a universal program, the only way is to load all the
encoding libraries?Can I use unicode to solve the problem.

PS:I test ruby installed in my computer, it has so many encodings.And
the default encoding is GBK, exactly my computer’s code page.I guess
the embeded ruby doesn’t have GBK encoding, so it use ASCII-8BIT
instead.
I find the library files under ‘\lib\ruby\1.9.1\i386-mingw32\enc’.How
dos ruby load the encoding libraries?

ladace wrote in post #1008555:

To implement a universal program, the only way is to load all the
encoding libraries?Can I use unicode to solve the problem.

Because you haven’t shown any code, it’s hard to be specific.

To the OS, a filename is just sequences of bytes (which may happen to be
the same as a set of characters represented by a particular encoding,
but it doesn’t really care)

So if you do

File.open("xyz")

it will work, as long as “xyz” is the correct sequence of bytes for that
filename.

Can you show an example of a case where you’re having a problem?

It maybe that you’re typing

File.open("groß")

into an editor which uses one character set and encoding (say UTF-8),
but when you created the file you did so at the command prompt, where
the symbol was encoded differently.