I am working on translating one phrase in particular language to another (For eg English to Hindi). This translation works file as while outputting the results i am using UTF-8. But when i enter the query to be converted back to English from Hindi the search is not performed as sql queries are not able to search it in the database as character coding changes.How can I work towards seemless operabilityfrom one type of language to another.
Ankuj Gupta schreef:
I am working on translating one phrase in particular language to another (For eg English to Hindi). This translation works file as while outputting the results i am using UTF-8. But when i enter the query to be converted back to English from Hindi the search is not performed as sql queries are not able to search it in the database as character coding changes.How can I work towards seemless operabilityfrom one type of language to another.
Could you be more specific as to exactly what goes wrong? The API outputs UTF-8 and should accept input in UTF-8 as well.
Roan Kattouw (Catrope)
For eg Select * from page where page_title='インド' is my query. How to execute this query on mysql tables as data is not stored in utf-8 format as it displays weird characters and thus no result is displayed. If i try the php function utf_decode still it does not work.
Ankuj Gupta schreef:
For eg Select * from page where page_title='インド' is my query. How to execute this query on mysql tables as data is not stored in utf-8 format as it displays weird characters and thus no result is displayed. If i try the php function utf_decode still it does not work.
I'm not sure whether you're asking this question on the API list, since it's intended for questions about the API, which you're not using.
Anyway, you could try pointing a MediaWiki install to use the database you're querying, and use api.php?action=query&titles=Whatever , which should work correctly.
Roan Kattouw (Catrope)
Ankuj Gupta wrote:
For eg Select * from page where page_title='インド' is my query. How to execute this query on mysql tables as data is not stored in utf-8 format as it displays weird characters and thus no result is displayed. If i try the php function utf_decode still it does not work.
-- Ankuj
It *is* stored in utf-8. Even if mysql thinks it's latin1. So you may need to lie on the connection.
mediawiki-api@lists.wikimedia.org