Page 1 of 1

UDP API Content Encoding

Posted: Fri Oct 14, 2005 6:31 pm
by aredhel
The API says:
escape scheme for option values: html form encoding + newline
I thought I knew what this meant but on further testing I don't. Would some one explain exactly what this means, and give before and after example strings. Or better yet update the api docs with that info.

-aredhel

Posted: Sun Oct 30, 2005 1:49 am
by exp
basically it means anything a webbrowser would correctly render might happen :P
which means there are multiple ways each character could be represented.
yeah I know, this sucks, but it's a legacy problem.

BYe!
EXP

Posted: Tue Nov 01, 2005 6:16 am
by aredhel
Thank you for getting back to me.

So when getting data back from the udp api 2, you get html fragments with the char '|' stripped. I think I can deal with that.

My main problem right now is how to quote data sent to to the api. In the web interface it's easy to set a field to some unicode chars like : "ミ☆", which comes back from the udp api as:

Code: Select all

"& #12511;& #9734;" //spaces added to keep webbrowsers from rendering as unicode chars.
But I can't for the life of me figure out how to use the udp api to put "ミ☆" into a field.

If it can't be done in udp api v2, the two weeks I spent thinking about how you might have done it have given me some ideas on how to do it in the next version. Where whould be the best place to bring those ideas up?

-Aredhel

Posted: Tue Nov 01, 2005 6:27 am
by PetriW
aredhel wrote:But I can't for the life of me figure out how to use the udp api to put "ミ☆" into a field.
Huh? This doesn't make sense...
html encoding is simple "&# unicode number ;", aka your application has to support unicode to use the titles, actually converting them is trivial.

Posted: Tue Nov 01, 2005 3:38 pm
by exp
aredhel wrote:If it can't be done in udp api v2, the two weeks I spent thinking about how you might have done it have given me some ideas on how to do it in the next version. Where whould be the best place to bring those ideas up?
not sure what you mean, but this is the place to go for future udp api changes.
http://www.anidb.net/forum/viewtopic.php?t=4466

BYe!
EXP

Posted: Wed Nov 02, 2005 10:31 am
by aredhel
PetriW wrote:
aredhel wrote:But I can't for the life of me figure out how to use the udp api to put "ミ☆" into a field.
Huh? This doesn't make sense...
html encoding is simple "&# unicode number ;", aka your application has to support unicode to use the titles, actually converting them is trivial.
Here is an example of whats happening. please note that ミ☆ are both "&# unicode number ;" it just the forum is not quoting the & properly, and not leting me quote it my self.

Code: Select all

> MYLISTADD lid=8082697&edit=1&storage=fooミ☆&tag=qhvuh&s=a2Lp1
< qhvuh 311 MYLIST ENTRY EDITED
> MYLIST lid=8082697&tag=cthpb&s=a2Lp1
< cthpb 221 MYLIST
8082697|105967|3925|318|0|1123869037|0|0|foo||
Note that the the add was accepted but the storage field was truncated. My guess is this is because & is the field separator. If I had writen the server end of the api it would have returned a "505" because "#12511;" is not a known field nameand is not fallowed by a "=". If there is not a way to escape a "&" char then you can't input unicode chars with this api.

-Aredhel

[EditRar: Escaped as intended]

Posted: Wed Nov 02, 2005 11:34 am
by Rar
Really, english/romaji ep titles should be ascii only, feel free to creq out any escaped unicode.

Rar

Posted: Fri Nov 04, 2005 10:06 am
by epoximator
this will be fixed in the next version of the server. (the storage field will not be truncated on aredhels example)