by Bowzin » Sun Apr 19, 2020 2:09 pm
by Frisbeeteria » Sun Apr 19, 2020 4:15 pm
by Bowzin » Sun Apr 19, 2020 5:05 pm
Frisbeeteria wrote:There are a large number of UniCode character sets: UTF-8 and many others. Since this site started in 2002 and has been added to on an irregular basis ever since; we do not have a single UTF standard across the entire site. It would take a massive rebuild of the older portions to make it uniformly compliant, and [violet] decided there were better uses for her time.
In any given segment or element of the site, you will simply have to see what works and what doesn't. Sorry.
by [violet] » Sun Apr 19, 2020 6:17 pm
by Bowzin » Sun Apr 19, 2020 6:19 pm
[violet] wrote:This is now fixed. I hadn't added UTF8 support to the API because until recently you couldn't upload any content to it. But now you can post Dispatches, so it's needed.
There still may be a few oddities because, as Fris says, our character encoding is a bit of a mess. But the API should now be consistent with the rest of the site.
With this change, I have also bumped the API version number to 11. If you require the old method (i.e. no UTF8 support), you should request version 10 or earlier via the API's "v" parameter: https://www.nationstates.net/pages/api.html#versions
by Bowzin » Sun Apr 19, 2020 7:35 pm
by Bowzin » Sun Apr 19, 2020 11:55 pm
by Bowzin » Wed Apr 22, 2020 10:13 pm
by [violet] » Wed Apr 22, 2020 10:20 pm
by Racoda » Thu Apr 23, 2020 12:36 am
curl -H "X-Pin: ####" -A "CLI test" "https://www.nationstates.net/cgi-bin/api.cgi" --data "nation=rsca&c=dispatch&dispatch=add&title=U2756%20UrlEncoded&category=1&subcategory=105&mode=execute&token=0123456abcdef" --data-urlencode "text=Test: ❖"
curl -H "X-Pin: ####" -A "CLI test" "https://www.nationstates.net/cgi-bin/api.cgi" --data "nation=rsca&c=dispatch&dispatch=add&title=U2756%20escaped%20UrlEncoded&category=1&subcategory=105&mode=execute&token=0123456abcdef" --data-urlencode "text=Test: ❖"
by Bowzin » Thu Apr 23, 2020 1:20 am
Racoda wrote:(Not OP)
I did a few tests from the command line/curl.
- Code: Select all
curl -H "X-Pin: ####" -A "CLI test" "https://www.nationstates.net/cgi-bin/api.cgi" --data "nation=rsca&c=dispatch&dispatch=add&title=U2756%20UrlEncoded&category=1&subcategory=105&mode=execute&token=0123456abcdef" --data-urlencode "text=Test: ❖"
Publishing a dispatch with ❖ results in the character becoming a question mark: Test: ?
- Code: Select all
curl -H "X-Pin: ####" -A "CLI test" "https://www.nationstates.net/cgi-bin/api.cgi" --data "nation=rsca&c=dispatch&dispatch=add&title=U2756%20escaped%20UrlEncoded&category=1&subcategory=105&mode=execute&token=0123456abcdef" --data-urlencode "text=Test: ❖"
However, escaping ❖ to be ❖ does work (bug? feature?): the result is Test: ❖
by Bowzin » Sun Apr 26, 2020 11:56 pm
Advertisement
Users browsing this forum: East Leaf Republic, Gabrielos, Giovanniland, Kushinas Parrots, Tinhampton
Advertisement