Problems when using German umlautes

31 megtekintés
Ugrás az első olvasatlan üzenetre

dalelane

olvasatlan,
2008. nov. 10. 17:18:362008. 11. 10.
– Twitter Development Talk
I'm having problems when posting updates that contain German umlaut
characters.

The character immediately following some German umlaut characters is
apparently lost.

The problem does not appear to be limited to my app, and can be more
simply repeated using curl:

curl --basic --user username:password --data "status=BEFORE%D6AFTER"
http://twitter.com/statuses/update.xml

results in the following update:

BEFOREÖFTER

My app does specify charset=utf-8 in the header, although this doesn't
appear to be helping.

Any advice as to what I'm doing wrong would be much appreciated.

Esmil

olvasatlan,
2008. nov. 11. 7:50:282008. 11. 11.
– Twitter Development Talk
You should also send your message to twitter in proper UTF-8 format.
The character \0xD6 is encoded in UTF-8 as the two characters
\0xC3\0x96,
so this works:

curl --basic --user username:password --data "status=BEFORE
%C3%96AFTER" http://twitter.com/statuses/update.xml

/Emil

dalelane

olvasatlan,
2008. nov. 11. 9:53:542008. 11. 11.
– Twitter Development Talk
ah, that's very helpful, thanks. I thought I could get away with just
url-encoding the message - I hadn't realise I needed to utf-8 encode
it too.

many thanks for your help

kind regards

Dale
Válasz mindenkinek
Válasz a szerzőnek
Továbbítás
0 új üzenet