REST: special characters

(imported topic written by JesperLarsen)

Hi

Im trying to use the REST api to create users. The usernames can be any valid UTF8-name, so when posting to the REST service (api/operators) i send this XML:

<?xml version="1.0" encoding="UTF-8"?> HôtelBravo delme20x false true true Unrestricted ShowAll

The operator gets created, but the return from the post says:

<?xml version="1.0" encoding="UTF-8"?> HôtelBravo Thu, 01 Jan 1970 00:00:01 +0000 false true true Unrestricted ShowAll

Now, looking at the raw bytes, when i send the ô, it is encoded as C3B4 as i would expect it to be with UTF-8, but then returned from the server (even though it says UTF-8 in the header) it returns the bytes C383 C2B4.

And when looking in the Management console, i can see that the newly created operator is named HôtX_delme20x and not HôtelBravo.

I can make the ô happen by converting the UTF-8 version of ô into ANSI… Can someone confirm that the Name-parameter (others?) is read as ANSI and not UTF-8?

Kind regards Jesper

(imported comment written by SteveHull)

IEM does not yet have full support for UTF-8, so you are limited to the ANSI codepage that the server is installed in for all fields, property results, etc.

(imported comment written by JesperLarsen)

Thanks Steve. Ill just make some encoding myself then.

Suppose the proper answer from the webservice should have been “not supported codepage” if the XML explicitly states UTF-8.

/Jesper

(imported comment written by SteveHull)

Yeah, I think you’re encountering a side effect of our future plans to add UTF-8 support. If I’m recalling correctly, the REST API does support it, with future full support in mind, but the rest of the server and database’s lack of support converts the request to ANSI when executed.

Regards, Steve