from a ruby script if i list the ENV hash i get (between others) :
__CF_USER_TEXT_ENCODING => 0x1F5:0:1
when the script is ran from a user and :
__CF_USER_TEXT_ENCODING => 0x0:0:1
when run via sudo.
however i have :
imyt% sudo cat /var/root/.CFUserTextEncoding
imyt% cat ~/.CFUserTextEncoding
pretty the same.
could that explain the fact that when running a script via sudo i do
have to force encoding ie :
File.open(MACSOUP_SIGNATURES_FILE,:encoding => “UTF-8”)
and no need for ":encoding => “UTF-8"” when running as user.
i’m suing :
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10]
and notice that in both cases i do have :
LANG => fr_FR.UTF-8