?

Log in

No account? Create an account
January 10th, 2008 - LiveJournal Development [entries|archive|friends|userinfo]
LiveJournal Development

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

January 10th, 2008

Encodings and a client [Jan. 10th, 2008|04:03 pm]
LiveJournal Development

lj_dev

[dimrub]
[Tags|, , ]

Hi, all!

I've hacked together a GreaseMonkey script that cross posts entries from Vox to LJ. Everything works fine, until I try to post Unicode stuff. It seems to go through OK (with Unicode chars encoded by the encodeURIComponent function each into something like this: %XX%XX), and the entry appears just fine in the friends list, but then I can't edit it, and I get the following when I try to:

Error
Client error: Invalid text encoding: Cannot display this post. Please see http://www.livejournal.com/support/encodings.bml for more information.

So I tried using escape() instead, which results in each Unicode char being encoded as %uXXXX instead of %XX%XX - and now the text is presented as is, in the encoded form. I also tried omitting encoding altogether (only escaping the ampersand), with the same result as with encodeURIComponent. Question is, what does LJ expect to see there exactly (and, perhaps, how to achieve it in JavaScript)?

Thanks!
link3 comments|post comment

navigation
[ viewing | January 10th, 2008 ]
[ go | Previous Day|Next Day ]