?

Log in

No account? Create an account
Server returns ISE for a ATOM API UTF8 post with international characters. - LiveJournal Client Discussions [entries|archive|friends|userinfo]
LiveJournal Client Discussions

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

Server returns ISE for a ATOM API UTF8 post with international characters. [Oct. 20th, 2005|08:08 am]
LiveJournal Client Discussions

lj_clients

[orangebitch]
I have been using home grown software with ATOM API for a while to post to LJ. Lately I fixed the encoding to be proper UTF8 and now when posting international characters server returns 500 Internal Server Error. Without international characters everything works fine.

Capture for the body from the post: http://www.dblock.org/bric-a-brac/lj/cap1.gif

Ideas?

Thx
dB.
linkReply

Comments:
[User Picture]From: quirrc
2005-10-21 08:38 pm (UTC)
That is text that worked:

<?xml version="1.0" encoding="UTF-8"?><entry xmlns="http://purl.org/atom/ns#"><generator
url="http://semagic.sourceforge.net">Semagic
1.5.5.2U</generator><created>2005-10-21T20:33:02Z</created><content
type="text/html"
mode="escaped">&lt;STRONG&gt;&lt;U&gt;абвг&lt;/U&gt;&lt;/STRONG&gt;</content></entry>


Response:

<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://purl.org/atom/ns#">
  <title
xmlns="http://purl.org/atom/ns#"></title>
 
<summary xmlns="http://purl.org/atom/ns#">&lt;STRONG&gt;
 
&lt;U&gt;&amp;#x430;&amp;#x431;&amp;#x432;&amp;#x433;&lt;/U&gt;
&lt;/STRONG&gt;</summary>
 
<link xmlns="http://purl.org/atom/ns#"
type="application/x.atom+xml" rel="service.edit" href="http://test.livejournal.org/interface/atom/edit/265"
title=""/>
  <link xmlns="http://purl.org/atom/ns#" type="text/html"
rel="alternate" href="http://test.livejournal.org/users/quirrc/67930.html"
title=""/>
</entry>


That is unicode, real request is in utf8. Then start adding your data and see when it will stop working.
(Reply) (Thread)
[User Picture]From: orangebitch
2005-10-22 05:36 pm (UTC)
I spent some time on this with no results - maybe something wrong with my encoding. Would it be possible to get the full working repro - a full netmon trace for example?

Much appreciated,
dB.

dblock at dblock dot org if you want to e-mail something
(Reply) (Parent) (Thread)
[User Picture]From: quirrc
2005-10-22 06:10 pm (UTC)
you have data that works and that does not. merging them until it stops working will show the error for sure. also you test with very complex html, use plain text and specify all other attributes that i used like mode=escaped. the error may be in html rather than in encoding but appearing only for non english text.
(Reply) (Parent) (Thread)
[User Picture]From: orangebitch
2005-10-22 07:12 pm (UTC)
Yep, I was chasing a red herring. The real problem was malformed xml generated by my code, a side effect of Russian characters.
(Reply) (Parent) (Thread)
[User Picture]From: orangebitch
2005-10-22 07:01 pm (UTC)
Nevermind! I was chasing a red herring. Some side effect of having russian text was generating malformed xml, stuff that should have been in a CDATA section.

Thanks!
dB.
(Reply) (Parent) (Thread)