Invalid XML Format on REST response

jberd126jberd126 Registered Users Posts: 36 Big grins
edited September 23, 2005 in SmugMug API Support & Integrations
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 [color=red]232[/color] 115

I found this when I was trying to parse the XML using .NET's XMLTextReader.

-J

Comments

  • avonwyssavonwyss Registered Users Posts: 12 Big grins
    edited September 18, 2005
    jberd126 wrote:
    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. eek7.gif

    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? headscratch.gif

    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?
  • tibutibu Registered Users Posts: 71 Big grins
    edited September 23, 2005
    Me too
    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
  • avonwyssavonwyss Registered Users Posts: 12 Big grins
    edited September 23, 2005
    tibu wrote:
    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:
    [PHP] <Album id="38946">
    <Title>Mari Jüssi</Title>
    </Album>[/PHP]
    Instead of
    [PHP] <Album id="38946">
    <Title>Mari Jüssi</Title>
    </Album>[/PHP]
    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...
Sign In or Register to comment.