Unicode blues in Python3

nn pruebauno at latinmail.com
Wed Mar 24 14:08:26 CET 2010



Steven D'Aprano wrote:
> 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

Yes sorry it is a bit ambiguous. I don't really care what glyph is,
the program reading my output reads 8 bit values expects the binary
value 0xFD as control character and lets everything else through as is.



More information about the Python-list mailing list