What determines the encoding of a File # path?

In ruby ​​1.8.7, what determines what File#path will encode? File system? Configuration somewhere? Encoding of each individual file?

I saw two different encodings in other identical environments on different OS.

Related questions: Reading a file name in several OSs without a problem with Ruby encoding

Update

I think I need to set / know the encoding of the file system ... this does not help though (unless I put it in the wrong place) ...

  export LC_ALL = en_US.UTF-8
 export LC_CTYPE = en_US.UTF-8
+4
source share
1 answer

Theoretically, you can read system coding from

 ENV['LC_LANG'] 

and you can set it in the same way for ruby ​​script:

 ENV['LC_LANG']=en_US.UTF-8 

The same applies to other environment variables for a particular encoding.

+1
source

All Articles