unicode 3 digit decimal conversion

Rune Hansen rune.hansen at viventus.no
Sat Sep 27 20:33:23 EDT 2003


Hi Martin, you raise a very interesting question(at least for me it is :-).
The, otherwise, excelent support people at Stalker (it's a CommuniGate 
pro server I'm speaking to) has me totally confused.

What I tried to do was to send a quoteattr(u'string') (using quoteattr 
from sax). The server was very happy with this, showing the accented 
characters, when viewed in a telnet session, as human readable text. 
This, it became apparent, was obviously wrong. The data was garbled when 
viewing it in the web interface.

Stalker told me to send the  letter "ø" as \248 or as xf8 (notice  the 
missing "\"). At this point I'm sending 
quoteattr(unicode('string',"iso-8859-1).encode("utf-8")) which is 
neither of the above.(..?).
Anyway, the  server is still happy, and the data views correctly in the 
web interface.

Stalker provides a perl and java API for the telnet server.  I don't 
read perl code very well, and the java API is distributed as .class 
files(nothing new there, it's java after all) so I really don't know how 
Stalker is handling it.

regards

/rune

Martin v. Löwis wrote:
> Peter Otten <__peter__ at web.de> writes:
> 
> 
>>I see your problem is already solved
> 
> 
> I'm quite uncertain as to what the solution is, though - or perhaps
> what the problem is. The OP said that the telnet server expects
> backslash characters in the data stream (atleast I interpreted his
> message that way), but then he was happy with an approach that did not
> send backslash characters.
> 
> Perhaps the telnet server really expects latin-1, in which case
> encoding the Unicode string in that encoding, or in iso-8859-15,
> would work fine most of the time.
> 
> Regards,
> Martin





More information about the Python-list mailing list