?

Log in

No account? Create an account
widget for osx - LiveJournal Client Discussions — LiveJournal [entries|archive|friends|userinfo]
LiveJournal Client Discussions

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

widget for osx [May. 11th, 2005|12:03 am]
LiveJournal Client Discussions

lj_clients

[zloba]
Hello. I am writing a widget for osx to update a livejournal.

Currently it is using http://www.livejournal.com/interface/flat interface to post entries, get challenges and so on. After finishing and polishing the code, I've realized, that it is not able to post non-english letters. How can it be fixed? Is there any way to specify the encoding in flat interface?
linkReply

Comments:
[User Picture]From: int
2005-05-10 11:20 pm (UTC)
Well that's how I do it... I use encodeURIComponent() on the post data, and make sure ver=1 is sent with the request, and it all works.
(Reply) (Parent) (Thread)
[User Picture]From: zloba
2005-05-11 12:56 am (UTC)
what is ver=1?
(Reply) (Parent) (Thread)
[User Picture]From: int
2005-05-11 02:51 am (UTC)
Means that the client supports Unicode and LJ should recognise it.
(Reply) (Parent) (Thread)
[User Picture]From: zloba
2005-05-11 09:59 pm (UTC)
thanks, it helped me.
(Reply) (Parent) (Thread)
[User Picture]From: fus
2005-05-19 07:41 am (UTC)
thankyou for this piece of information, was grappling with a 'non-Unicode' client issue for over an hour, ready to pull my hair out when i saw this.
(Reply) (Parent) (Thread)
[User Picture]From: int
2005-05-19 07:56 am (UTC)
I have a feeling everyone has this problem when initially writing their posting functions. :P
(Reply) (Parent) (Thread)
From: livewidget
2005-05-21 04:56 am (UTC)
I'm trying to get the right combination of ver and encodes to get my JavaScript based client posting links and formatting tags without the server the throwing a hissy fit at me.

At the moment I use encodeURIComponent() on my Subject, Music, Mood and Entry then add this ti the info posted via XMLRPC

'ver
[Error: Irreparable invalid markup ('<value<int>') in entry. Owner must fix manually. Raw contents below.]

I'm trying to get the right combination of ver and encodes to get my JavaScript based client posting links and formatting tags without the server the throwing a hissy fit at me.

At the moment I use encodeURIComponent() on my Subject, Music, Mood and Entry then add this ti the info posted via XMLRPC

'<member><name>ver</name><value<int>1</int></value></member>'

but the posts I make are filled with the converted characters, all the spaces are now "%" then "20" and so on.

Is there a missing link?
(Reply) (Parent) (Thread)
From: livewidget
2005-05-21 05:02 am (UTC)
d'oh, the I've missed out a right-angle-bracket in the post above, but it is there in my code
(Reply) (Parent) (Thread)
[User Picture]From: int
2005-05-21 05:07 am (UTC)
Err, you're only meant to use that if you're posting via the flat interface. XMLRPC you shouldn't have to do anything, other than put text inside <![CDATA[]]> tags (or just escape tags, and don't forget you have to base64 encode the music string otherwise it'll die if you try to send unicode strings through it).
(Reply) (Parent) (Thread)
From: livewidget
2005-05-21 05:14 am (UTC)
I've just been posting like this

{member}{name}event{/name}{value}{string}'+entry+'{/string}{/value}{/member}

and at one point it did work, I was sending tags fine, but I guess I've disconnected the esccaping code I had in there. hmmm

I'll change that to be
{member}{name}event{/name}{value}{string}{![CDATA['+entry+']]}{/string}{/value}{/member}

and see how I go (with all the "{"s being angle brackets)



(Reply) (Parent) (Thread)
From: livewidget
2005-05-21 05:33 am (UTC)
Worked as prescribed, you took a lot of debugging out of my day :-)
(Reply) (Parent) (Thread)