On 12.06.07, Russell Steicke wrote:
On Mon, Jun 11, 2007 at 04:02:03PM +0200, Joerg Lehmann wrote: ...
There is a small problem with that one, though: If you don't use the C locale, string.letters may also contain non-ASCII characters and then "s in string.letters" fails for any Unicode string. In the present case this means it fails always. This seems to be one of the cases where Python's unicode support is still lacking...
Yes, I hadn't thought of that. Does string.punctuation suffer from the same problem? Are there punctuation characters in Unicode outside the ASCII range? (That question may reveal that I don't fully understand the problem...)
No, you're question is fully right and in fact, I had the same idea. Maybe a better solution indeed would be to replace the logic in that way. I also don't know, though, whether string.punctuation lies always in the ASCII range (but it's definitely more probable).
I'm going to leave the patch in the version I run, though, as all my .oggs have ASCII tags at the moment. :)
I guess it's more that you run with a C locale. The PyTone version in the SVN repository internally uses Unicode strings for all tags. And this definitely fails:
u"123" in chr(130)
Cheers,
Jörg