From: Yukihiro Matsumoto Date: 2006-06-29T08:24:02+09:00 Subject: Re: Unicode roadmap? Hi, In message "Re: Unicode roadmap?" on Thu, 29 Jun 2006 02:33:36 +0900, "Austin Ziegler" writes: |I'm not sure I like the encoding pragma, personally, since it's at the |file level. Consider this: | | raise "Not PNG." unless @top[0, 8] == "\x89PNG\x0d\x0a\x1a\x0a" | |If I understand the encoding pragma correctly, both the "Not PNG" and |the matching string will be treated as Unicode, and the test string is |not valid Unicode. | |Better, from my perspective: | | raise u"Not PNG." unless @top[0, 8] == "\x89PNG\x0d\x0a\x1a\x0a" | |That way, I *mark* the strings for which I want Unicode format. The |encoding pragma makes it hard to do mixed content files. I'd rather see r"\x89PNG\x0d\x0a\x1a\x0a" (or b"..."), since I expect binary strings less often. It also removes unnecessary Unicode expectation from users. matz.