Unicode blues in Python3

Steven D'Aprano steven at REMOVE.THIS.cybersource.com.au
Wed Mar 24 00:41:01 EDT 2010


On Tue, 23 Mar 2010 11:46:33 -0700, nn wrote:

> Actually what I want is to write a particular byte to standard output,
> and I want this to work regardless of where that output gets sent to.

What do you mean "work"?

Do you mean "display a particular glyph" or something else?

In bash:

$ echo -e "\0101"  # octal 101 = decimal 65
A
$ echo -e "\0375"  # decimal 253
�

but if I change the terminal encoding, I get this:

$ echo -e "\0375"
ý

Or this:

$ echo -e "\0375"
²

depending on which encoding I use.

I think your question is malformed. You need to work out what behaviour 
you actually want, before you can ask for help on how to get it.



-- 
Steven



More information about the Python-list mailing list