# How to obtain the default encoding of system?

**URL:** <https://www.ruby-forum.com/t/how-to-obtain-the-default-encoding-of-system/117847>\
**Category:** Ruby\
**Created:** [October 21, 2007, 2:26pm UTC](https://www.ruby-forum.com/t/how-to-obtain-the-default-encoding-of-system/117847 "2007-10-21T14:26:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![liwenqiu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9d8465/32.png) [@liwenqiu](https://www.ruby-forum.com/u/liwenqiu)\
**Post date:** [October 21, 2007, 2:26pm UTC](https://www.ruby-forum.com/t/how-to-obtain-the-default-encoding-of-system/117847/1 "2007-10-21T14:26:50Z")

</div>

a script run on linux or windows, i want to know the encoding of system,  
in  
order to ouput suitable string.thanks
