# Windows command & unicode

**URL:** <https://www.ruby-forum.com/t/windows-command-unicode/76060>\
**Category:** Ruby\
**Created:** [November 15, 2006, 5:12pm UTC](https://www.ruby-forum.com/t/windows-command-unicode/76060 "2006-11-15T17:12:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [November 15, 2006, 5:12pm UTC](https://www.ruby-forum.com/t/windows-command-unicode/76060/1 "2006-11-15T17:12:43Z")

</div>

Hi all,

I have a problem using unicode characters in the windows command.

As a very simple example, when I type this:

H:\>ruby -e ‘puts “rien à faire”’

I will get the following:

rien Ó faire

Does anyone know what causes this?  
When I run my scripts from Scite, this problem doesn’t come up.

Kind regards,  
Maarten

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [November 15, 2006, 5:30pm UTC](https://www.ruby-forum.com/t/windows-command-unicode/76060/2 "2006-11-15T17:30:47Z")

</div>

On 11/15/06, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> rien Ó faire
> 
> Does anyone know what causes this?  
> When I run my scripts from Scite, this problem doesn’t come up.

I believe the Windows command prompt displays text using the system  
codepage (the Regional Settings control panel). I’m not aware of a way  
to make it treat things as real UTF-8.

Let me know if you figure it out, though. Heh.

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [November 15, 2006, 5:50pm UTC](https://www.ruby-forum.com/t/windows-command-unicode/76060/3 "2006-11-15T17:50:49Z")

</div>

On 11/15/06, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> rien Ó faire
> 
> Does anyone know what causes this?  
> When I run my scripts from Scite, this problem doesn’t come up.

Please search the archives. There was a discussion about the  
limitations of cmd.exe and Unicode. What you want generally can’t be  
done from the command-line in Windows.

-austin

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [November 15, 2006, 9:01pm UTC](https://www.ruby-forum.com/t/windows-command-unicode/76060/4 "2006-11-15T21:01:33Z")

</div>

On Nov 15, 5:48 pm, “Austin Z.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > I will get the following:  
> > Austin Z. \* removed\_email\_address@domain.invalid \*[http://www.halostatue.ca/](http://www.halostatue.ca/)  
> > \* removed\_email\_address@domain.invalid \*[http://www.halostatue.ca/feed/](http://www.halostatue.ca/feed/)  
> > \* removed\_email\_address@domain.invalid

Thanks, this got me on my way.

It seems this works:

require ‘iconv’  
puts Iconv.new(“ibm850”,“iso-8859-1”).iconv(“rien à faire”)
