re.compile.match() results in unicode strings - why?

Axel Bock news-and-lists at the-me.de
Fri Nov 12 05:28:33 EST 2004


Kent Johnson wrote:

> Apparently if the input strings are unicode then the groups will be as 
> well:
> [...]
> Are you sure that exp is not a unicode string?

hm. pretty much - i read the lines from a text file which contains only normal 
text. a sample line looks like that:

6. 	 call_noparam 	 1000 runs  	 149453,1 ms 	 149,4531 ms/call

no surprise here, i think ... . Actually I also wrote the program which 
produces that file, and I really didn't use unicode then. opening the file 
with a text editor also does not show unicode, and I can't believe that 
windows does actually manage the unicode stuff transparently to text editors. 
and also I have never heard of file-attached codepage information, those would 
be the only things i could imagine as a reason.

but interesting though, thanks!


ciao,

axel.



More information about the Python-list mailing list