# Iconv platform difference

**URL:** <https://www.ruby-forum.com/t/iconv-platform-difference/145325>\
**Category:** Ruby\
**Created:** [August 8, 2008, 12:55am UTC](https://www.ruby-forum.com/t/iconv-platform-difference/145325 "2008-08-08T00:55:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ProzakLord](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/d9b06d/32.png) [@ProzakLord](https://www.ruby-forum.com/u/ProzakLord)\
**Post date:** [August 8, 2008, 12:55am UTC](https://www.ruby-forum.com/t/iconv-platform-difference/145325/1 "2008-08-08T00:55:35Z")

</div>

Hi all,

Relatively new to Ruby as in 2 weeks so this may be dead obvious but  
have not found any results in my searches

I use the net/http to get a bit of xml from a website that I put in  
@doc.  
The xml is ISO-5589-1 encoded so on windows I have to run an  
Iconv.conv(@ doc.encoding,“UTF-8”,strFromXml)  
now when I run the same script on “Linux ruby 1.8.6 (2007-09-24  
patchlevel 111) [x86\_64-linux]”  
The characters appear garbled. For the characters to be clear I need  
to take out the Iconv call.

Is there a way of detecting what is the platforms character encoding  
so that I can skip the conversion step if they match?

Thanking you in advance.
