How to find number of characters in a unicode string?

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Fri Sep 29 03:52:28 EDT 2006

In message <pan.2006. at>, Marc 'BlackJack'
Rintsch wrote:

> In <20060918221814.08625ea2.randhol+valid_for_reply_from_news at>,
> Preben Randhol wrote:
>> Is there a way to calculate in characters
>> and not in bytes to represent the characters.
> Decode the byte string and use `len()` on the unicode string.

Hmmm, for some reason


returns 2.

More information about the Python-list mailing list