From: Brian Q. <br...@sw...> - 2002-01-11 00:14:38
|
Paul Prescod wrote: > Finn Bock wrote: > > > >... > > > > IMO, there is very little unification between java byte arrays and java > > strings and the methods that existed initially to convert between them > > have since been deprecated. That is A Good Thing because it clearly > > separates the obvious use of bytes and characters. > > You are right. What I meant was that "plain old strings" are Unicode in > Java. Byte arrays are not considered strings at all. And this is the real problem. Python strings are really just (unsigned) byte arrays. In any case, it problematic to map two different types (string and Unicode objects) to the same Java type. > > >then it should probably treat them all as Unicode strings, not as > > >8-bit. > > > > Then unicode() would be a no-op. It would just return the argument > > without doing anything. > > Is that a problem? If the user specifies an encoding then you could > decode. If they don't, I would suggest to just do a no-op. Under what > circumstances would the current exception be more helpful? Because you are specifically looking for the exception to see if the string can be converted to a Unicode object using the default encoding? Cheers, Brian |