View Full Version : Invalid XML Format on REST response
jberd126
Apr-29-2005, 11:08 AM
It appears that an element's text returned from a REST may not be encoding extended characters properly.
I'm seeing it one several of my photo's Caption fields. For example:
http://jayandshell.smugmug.com/gallery/361508/1/14444233/Medium
On a call to smugmug.image.getInfo, the return had a badly encoded character at byte index 220. It's an accented lowercase e (è). The correct UTF8 encoding is the byte sequence 195 168, however I'm getting the single byte 232. :scratch
_a_ _p_ _r_ _è_ _s_
97 112 114 232 115
I found this when I was trying to parse the XML using .NET's XMLTextReader.
-J
avonwyss
Sep-18-2005, 01:57 PM
It appears that an element's text returned from a REST may not be encoding extended characters properly.
Confirmed today with REST (V 1.1.0) on other methods. Apparently, it always writes the UTF-8 charset into the XML-declaration (at least when the request was UTF-8), but in fact it uses the ISO-8859-1 (Latin 1) encoding. :huh
This is a serious bug, because XML parsers will read the XML declaration and use the encoding specified in it; I currently get exceptions from the parser because invalid chars are encountered due to the wrong encoding.
Why hasn't this been adressed yet (the bug was first posted almost half a year ago)? I guess that hardcoding the response XML declaration to specify the ISO-encoding would be a quick and simple fix? :scratch
I really like smugmug and I think that the API is a great thing, but for the few days I've been working with it (or trying), it has become clear that there are just too many bugs to cope with - not in the BETA, but even in the normal API. While I know that the API is "as-is" and without support, I must say that I'm quite disappointed with my experience so far, I didn't expect it to be so bad.
Like this annoying bug which returns the "invalid API key" error if you don't wait up to 60s or so before issuing a call after the login. Or logout which always returns "invalid session" when called via REST (which is a serious security risk, since one can just reuse someone's session ID up to 6 hours after it was used). Hey guys, c'mon, this can't be serious?
tibu
Sep-23-2005, 05:32 AM
Hi
I just want to add my name to this bug. It probably foes unnoticed by english speaking people but for the rest of us is a problem. I get this errors whenI call getTree and albums come like this one:
<Album id="38946">
<Title>Mari Jüssi</Title>
</Album>
Instead of
<Album id="38946">
<Title>Mari Jüssi</Title>
</Album>
Regards
Carlos
avonwyss
Sep-23-2005, 10:04 AM
I just want to add my name to this bug. It probably foes unnoticed by english speaking people but for the rest of us is a problem. I get this errors whenI call getTree and albums come like this one:
<Album id="38946">
<Title>Mari Jüssi</Title>
</Album>
Instead of
<Album id="38946">
<Title>Mari Jüssi</Title>
</Album>
Regards
Carlos
(Tip: if you disable that full blown editor and enclose the XML as "PHP", it will post code correctly)
Hi Tibu, and thanks for adding your name. I hope this will be fixed soon since it really shouldn't require much to be fixed...
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.