Дима Рубинштейн (dimrub) wrote in lj_dev,
Дима Рубинштейн
dimrub
lj_dev

Encodings and a client

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!
Tags: client, client: posting, code: javascript
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 3 comments