Windows command & unicode

M

m44rt3n

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
 
W

Wilson Bilkovich

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 =E0 faire"'

I will get the following:

rien =D3 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.
 
A

Austin Ziegler

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 =E0 faire"'

I will get the following:

rien =D3 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
--=20
Austin Ziegler * (e-mail address removed) * http://www.halostatue.ca/
* (e-mail address removed) * http://www.halostatue.ca/feed/
* (e-mail address removed)
 
M

m44rt3n

limitations ofcmd.exeandUnicode. What you want generally can't be
done from the command-line in Windows.

-austin


Thanks, this got me on my way.

It seems this works:

require 'iconv'
puts Iconv.new("ibm850","iso-8859-1").iconv("rien à faire")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top