From: Josef 'Jupp' SCHUGT Date: 2003-11-21T10:06:13+09:00 Subject: Re: A question about Charsets Hi! * Eric-Roger Bruecklmeier; 2003-11-20, 20:30 UTC: > in a new application i have to read dBase III Files which were generated > in a DOS enviroment. How can i convert the Data into Windows codepages > from ruby? Map each Byte to the corresponding one using a hash. You need the codepages. DOS codepages are listed here: http://dwd.da.ru/charsets/index.html#dos-specific Windows codepages are listed here: http://dwd.da.ru/charsets/index.html#windows-specific The mapping is troublesome because of two reasons: First of all all DOS characters have Windows standard codepage counterparts (greek letters for example) and 0..31 can be either control chars or pictograms. So the best you can do is use the above tables and create Arrays or hashes that do the mapping. For cp850 and cp866 you can use iconv, otherwise you can use recode. This can be done from Ruby but it requires the appropriate software being in place. Bad if you want software to be portable. Josef 'Jupp' Schugt -- .-------. message > 100 kB? / | | sender = spammer? / | R.I.P.| text = spam? / ___| |___