Project

General

Profile

Bug #10493

Updated by nobu (Nobuyoshi Nakada) almost 8 years ago

 
 ~~~ruby ~~~ 
 name = Etc.getlogin # I've Windows username "Dāvis" 
 puts name             # D�vis 
 puts name.inspect     # "D\xE2vis" 
 puts name.encoding    # ASCII-8BIT 
 name.force_encoding('Windows-1257') 
 puts name             # Dāvis 
 ~~~ 

 As you can see \xE2 isn't "ā" in ASCII, but it is for Windws-1257 encoding. 


Back