Sorry for the delay, You are totally right. In order to get what I want I used formated_value = Iconv.new('UTF-8', 'CP850').iconv(input.to_s) And... It worked. But at the end I simply used the ADODB wrapper to open my dbf file and I did not have any character encoding problems after that. Thanks a lot. Jamal Abdou-Karim Bengeloun mortee wrote: > When converting some accented characters to \nnn then it doesn't use any > encoding. It just represents the verbatim non-ascii bytes it sees in the > string it gets. Encodig/decoding happens mainly when you input accented > chars on your keyboard, and they get converted to some byte (-sequence) > to be stored in a string, and when those strings are displayed, and they > are converted back to some printable characters. > > Problems arise when the displaying code interprets the same string > according to a different charset than what it was encoded according to. > > For example, when you puts a string in irb, then it's your terminal's > current charset which determines how the bytes in the string are > actually displayed. In contrast, when you use p (or, for that matter, > inspect), then non-ascii characters get ascaped as \nnn. > > mortee -- Posted via http://www.ruby-forum.com/.