From: James Gray Date: 2008-09-17T21:44:23+09:00 Subject: Re: How to clean an xml files from non-utf-8 chars? On Sep 17, 2008, at 4:07 AM, Krzysieq wrote: > I have a problem. I'm trying to parse with ruby some test results from > jmeter, that are stored in xml files. Unfortunately, while they > should be utf-8, some of them aren't. Probably because some db data > isn't. In any case, this makes other toys break down, like xslt > transformation and > anything else that relies on the xml files being utf-8. > > Does anyone know, how to get rid of such characters? If you can figure out the encoding they are actually in, I recommend using Iconv's transliterate mode: require "iconv" Iconv.conv("UTF-8//TRANSLIT", old_encoding_name, data) James Edward Gray II