[Python-Dev] just say no...
Fredrik Lundh
fredrik@pythonware.com
Fri, 12 Nov 1999 16:00:45 +0100
Fred L. Drake, Jr. <fdrake@acm.org> wrote:
> M.-A. Lemburg writes:
> > Such a buffer is needed to implement "s" and "s#" argument
> > parsing. It's a simple requirement to support those two
> > parsing markers -- there's not much to argue about, really...
> > unless, of course, you want to give up Unicode object support
> > for all APIs using these parsers.
>
> Perhaps I missed the agreement that these should always receive
> UTF-8 from Unicode strings.
from unicode import *
def getname():
# hidden in some database engine, or so...
return unicode("Linköping", "iso-8859-1")
...
name = getname()
# emulate automatic conversion to utf-8
name = str(name)
# print it in uppercase, in the usual way
import string
print string.upper(name)
## LINKöPING
I don't know, but I think that I think that it
perhaps should raise an exception instead...
</F>