From: Marko Marjanovic Date: 2007-06-27T23:37:21+09:00 Subject: Re: Encoding of strings received from db Axel Etzold wrote: > Dear mare, > > does the information here: > > http://groups.google.ca/group/rubyonrails-core/browse_thread/thread/db8d0c594cb4cc73 > > help ? Unfortunately it doesn't, because rails has some kind of configuration (I was only playing with rails, never digging deeper into it, so I'm not sure what it looks like). As for my problem, I'm trying to do this: db = PGconn.connect('localhost', 5432, '', '', 'isys', 'postgres', 'postgres') res = db.exec('select * from "ADDRESS"') puts res[1][1] == "S��dstrasse" and make the output "true". But i can't, because res[1][1] (second column of the second row) is in some other encoding and instead of S��dstrasse ("Sudstrasse" where "u" has umlauts - the two dots above the letter) I get S����dstrasse ("u" with umlauts is presented as two letters). I've tried using: Iconv.new('UTF-8', 'ISO-8859-1').iconv(res[1][1]) but now every byte that I have instead of umlauted u is transformed into another two characters - instead of u with umlauts, I now have 4 characters. I believe that the problem lies in 'postgres' gem and that it should be configured somehow, but I don't have the slightest idea how... -- Posted via http://www.ruby-forum.com/.