[UDP API] Content Encoding (PHP Issue)

Want to help out? Need help accessing the AniDB API? This is the place to ask questions.

Moderator: AniDB

Locked
KnightAR
Posts: 18
Joined: Mon Oct 06, 2003 3:24 am
Contact:

[UDP API] Content Encoding (PHP Issue)

Post by KnightAR » Wed Dec 27, 2006 7:08 am

A while ago, I've successfully been able to get the Kanji of an anime from the UPI server with php, now I cant. Basicly it's coming up as ????? instead of 星界の戦旗 for example. I have tried to change it to enc=utf8, but now they come up as 超時空騎団サザンクロス ... Anyone have any idea how to fix this?

Thanks

- KnightAR

User avatar
ricce
Posts: 199
Joined: Wed Apr 06, 2005 8:42 pm
Location: Sweden / Västrås
Contact:

Post by ricce » Wed Dec 27, 2006 8:33 am

You need to convert the UTF-8 to the local encoding...

I haven't read the udp API specs. but you may be able to tell the server your local locale using the auth line, as you specified utf-8. To me it look like you use some variant of iso-latin, witch can't view Kaji characters at all.

How this is done, depends on system and programming language.

KnightAR
Posts: 18
Joined: Mon Oct 06, 2003 3:24 am
Contact:

Post by KnightAR » Tue Jan 09, 2007 3:48 am

Your right, The default character set on the server was set to latin1. I changed it via mysql after connecting and it stores everything correctly now. Thanks much!

- KnightAR

Locked