# Best technique for detecting charset/character encoding of RSS feeds

**URL:** <https://www.ruby-forum.com/t/best-technique-for-detecting-charset-character-encoding-of-rss-feeds/155480>\
**Category:** Ruby\
**Created:** [December 12, 2008, 7:45am UTC](https://www.ruby-forum.com/t/best-technique-for-detecting-charset-character-encoding-of-rss-feeds/155480 "2008-12-12T07:45:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dcarneiro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e36b37/32.png) [@dcarneiro](https://www.ruby-forum.com/u/dcarneiro)\
**Post date:** [December 12, 2008, 7:45am UTC](https://www.ruby-forum.com/t/best-technique-for-detecting-charset-character-encoding-of-rss-feeds/155480/1 "2008-12-12T07:45:55Z")

</div>

I have a Ruby application that fetches RSS and Atom feeds. I’ve tried  
using the chardet gem (UniversalDetector) to figure out what the  
character encoding of each feed is. But for some strange this library  
thinks a lot of feeds are EUC-KR (Korean) when they plainly aren’t.

Can anyone suggest a better way to find the encoding of RSS and Atom  
feeds (e.g. via BOM detection, etc.) with Ruby?
