Right solution to unicode error?

A

Andrew Berg

It would be a lot better though if it just worked straight away
without me needing to set the code page (like the terminal in every
other OS I use).
The crude equivalent of .bashrc/.zshrc/whatever shell startup script for
cmd is setting a string value (REG_SZ) in
HKCU\Software\Microsoft\Command Processor named autorun and setting that
with whatever command(s) you want to run whenever the shell starts. Mine
has a value of '@chcp 65001>nul'. I actually run zsh when practical
(gotta love Cygwin) and I have an equivalent command in my .zshrc.
Getting unicode to work in a Windows is a hassle, but it /can/ work.
CPython does have a bug that makes it annoying at times, though -
http://bugs.python.org/issue1602
 
W

wxjmfauth

Le jeudi 8 novembre 2012 21:42:58 UTC+1, Ian a écrit :
Font has nothing to do here.
You are "simply" wrongly encoding your "unicode".



'–'



No, it seriously is the font. This is what I get using the default

("Raster") font:



C:\>chcp 65001

Active code page: 65001



C:\>c:\python33\python

Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600

32 bit (Intel)] on win32

Type "help", "copyright", "credits" or "license" for more information.
'–'

–

4



I should note here that the characters copied and pasted do not

correspond to the glyphs actually displayed in my terminal window. In

the terminal window I actually see:



ΓÇô



If I change the font to Lucida Console and run the *exact same code*,

I get this:



C:\>chcp 65001

Active code page: 65001



C:\>c:\python33\python

Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600

32 bit (Intel)] on win32

Type "help", "copyright", "credits" or "license" for more information.
'–'

–

4



Why is the font important? I have no idea. Blame Microsoft.

---------

If you have something like this 'ΓÇô'; in
Unicode nomenclature:.... ud.name(c)
....
'GREEK CAPITAL LETTER GAMMA'
'LATIN CAPITAL LETTER C WITH CEDILLA'
'LATIN SMALL LETTER O WITH CIRCUMFLEX'

it is a sign of a "cp437" somewhere.
'ΓÇô'

On Windows 7. I do not remember having once a "coding
of the caracters" issue on XP.

jmf
 

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

Similar Threads

Thinking Unicode 0
Unicode 2
split lines from stdin into a list of unicode strings 0
Convert unicode escape sequences to unicode in a file 1
unicode compare errors 3
unicode 7
Ascii to Unicode. 16
Unicode error 19

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top