From: Heesob Park Date: 2008-12-15T18:15:28+09:00 Subject: Re: get system encoding? Hi, 2008/12/15 Christian Kerth : > Hi! > > I have the following problem. > > I use the ruby function Dir.getwd to get the working directory of my > running ruby application. I need to save this via a firebird adapter to > my DB. > > When Dir.getwd contains special characters like "ß" the database insert > failes due to a wrong encoding. On my machine i have windows-1252 > encoding, the firebird adapter requires utf-8. If i force a charset > conversion with iconv from windows-1252 to UTF-8 it works. > > The open question is: How can i obtain the system encoding of my windows > machine? Try this irb(main):001:0> "windows-#{`chcp`.scan(/\d+$/)}" => "windows-949" HTH, Park Heesob