Log in

No account? Create an account
LiveJournal Client Discussions [entries|archive|friends|userinfo]
LiveJournal Client Discussions

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

UTF-8 in current_music/current_mood [Feb. 18th, 2004|08:54 pm]
LiveJournal Client Discussions
In my XML-RPC LJ client I am trying to post russian (KOI-8) text in current_music and mood fields. To do this I use KOI-8 to UTF-8 conversion. Server returns error "Client error: Invalid text encoding: The text entered is not a valid UTF-8 stream".
Everything works ok if using same conversion only for subject and text.

Is there any way to do smth with this, or current_music/current_mood should contain only english strings?
Thanks for any help.

From: evan
2004-02-18 11:13 am (UTC)
i see people posting with chinese music. i suspect it is a bug in your client.
(Reply) (Thread)
From: cryptoalex
2004-02-18 11:24 am (UTC)


Yep, for ex. LJ client - Semagic lets you to post music field in russian, but it does not use XML-RPC for posting (correct me if i am wrong please)..
(Reply) (Parent) (Thread)
[User Picture]From: krolain
2004-05-21 06:30 pm (UTC)
I'm finding I'm having the same issue with XML-RPC. I'm starting to ponder if it's worth it at this poitn. I seem to be giving up some important support when switching to XML.

Did you find a solution to this problem? Have you figured out a way to post non-english text in those fields? If so, how did you do it?

(Reply) (Thread)
From: cryptoalex
2004-05-23 04:42 am (UTC)
No, i failed to find solution to the problem, and was forced to make those fields accepting only ASCII text.
(Reply) (Parent) (Thread)
[User Picture]From: krolain
2004-05-23 06:18 pm (UTC)
Hi, I just wanted to let you know I finally figured it out, after many trial and errors.

The best way is to encode the text into base64-encoded binary. I stumbled upon this answer when one of my post ended up being sent to me in binary. I knew it was text since it was a post that I used a special character. Once I decoded the binary into bytes, then UTF-8 decoded that, the text appeared correctly.

So, the way to do it is:
1. UTF-8 byte encode the text
2. Encode the bytes into base64-encoded binary

That seems to work! :-) I may use base64 binary for all my text posting onto LJ.
(Reply) (Thread)