[XML-SIG] HTML<->UTF-8 'codec'?

Bill Janssen janssen@parc.xerox.com
Mon, 22 Oct 2001 15:05:28 PDT


> While doing so, it is advisable not to
> mix Unicode and byte strings in a single operation. E.g. when you
> write
> 
>   if input[i] == u'&'
> 
> then I believe input is a byte string, so this would be better
> 
>   if input[i] == u'&'
> 
> The former will fail if ord(input[i])>127.

I was uncertain as to whether "input" was a byte string or not, but in
any case I fail to see the difference between the two lines?  Did you mean

  if (unicode(input[i]) == u'&'):

Bill