When I Embedding ruby, the encoding list only have 3 items:US-ASCII
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
I find the library files under ‘\lib\ruby\1.9.1\i386-mingw32\enc’.How
dos ruby load the encoding libraries?