Unicode problem in ucs4

John Machin sjmachin at lexicon.net
Mon Mar 23 03:45:43 EDT 2009


On Mar 23, 6:41 pm, John Machin <sjmac... at lexicon.net> had a severe
attack of backslashitis:

> [presuming littleendian] The ucs4 string will look like "\t\0\0\0e
> \0\0\0s\0\0\0t\0\0\0" in memory. I suspect that your wprintf is
> grokking only 16-bit doodads -- "\t\0" is printed and then "\0\0" is
> end-of-string. Try your wprintf on sample[0], ..., sample[3] in a loop
> and see what you get. Use bog-standard printf to print the hex
> representation of each of the 16 bytes starting at the address sample
> is pointing to.

and typed \t in two places where he should have typed t :-)



More information about the Python-list mailing list