Invalid XML Format on REST response
jberd126
Registered Users Posts: 36 Big grins
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
I found this when I was trying to parse the XML using .NET's XMLTextReader.
-J
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 [color=red]232[/color] 115
I found this when I was trying to parse the XML using .NET's XMLTextReader.
-J
0
Comments
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?
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?
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:
Mari Jüssi
Instead of
Mari Jüssi
Regards
Carlos
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...