From: James Edward Gray II Date: 2006-11-09T22:36:26+09:00 Subject: Re: Charset detection On Nov 9, 2006, at 6:38 AM, David Vallner wrote: > Miquel Oliete wrote: >> Hi >> >> I'm coding a planet software in Ruby, like planet planet, but >> inserting >> all rss data into a database (mysql now) and showing the entries from >> database. >> >> I don't know how can I detect the rss charset. Can you help me? >> > > Look for the XML header? That one should list encoding. > > If it doesn't, bitch, whine, and moan at the feed author to do so, > charset detection is unavoidably a hack and shouldn't have to be > done by > now if interoperating apps are coded sanely. Right, cause XML encoding headers *never* lie. ;) If you have the header it's probably best to trust it. If not, libcharguess is quite accurate, even if David labels it a "hack." James Edward Gray II