I'm wondering how can I accept input in Hindi from my website's users?
All I know about is:
1. UTF-8 is the solution
2. add the following to the HTML Page:
<meta http-equiv="Content-Language" content="hi">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
3. MySQL database connection collation must be utf8_unicode_ci
If I paste anything from a hindi website like webduniya.com in my page's textbox it displays it correctly.
But I do not know how to get it by typing?
Yes, I agree, there is no relation with PHP. But with UTF-8 the language support is not mandatory. just check this website and it will open fine on your PC too. Type something in Search box and u'll see transliteration taking place: http://www.webduniya.com
They are not using google API: http://code.google.com/apis/ajaxlang...tation/#Single
They are using something else, although using google API could be best, I want to understand the implementation basics first..
Well surely you need a hindi keyboard or something?
The user would have to have a hindi keyboard - if they do, when they type on the keyboard it will display correctly in your input fields - as Shrapnel_N5 said you've got the right settings on the page and it's not a php problem.
Are you saying that if a user types an "H" on a querty keyboard, you want to display the letter that corresponds to H in the hindi alphabet?
So if i understand correctly you type on a normal qwerty keyboard and it comes up in hindi?
Then what you may be able to do is this:
<input type="text" style="font-family: hindi font;">
Don't know if you can change the fon't in a text box (haven't tried it) but you can in a text area i know, so if that doesn't work try
<text area style="font-family: hindi font;"></textarea>
But then of course the user has to have the hindi fonts installed. You can put a whole load of fall back fonts consisting of all the popular hindi fonts and hopefully the person will have one of them.
I finally used Google transliteration API, I think there is no other solution. Or if somebody is interested, he can develop his own transliteration API.
An implementation can be seen on http://www.greyboxtechnologies.com/dreamland
type something in the search box and when u press spacebar, it will be transliterated. I've used the same thing in the admin panel to enter the data, and it gets stored properly in my MySQL DB. This can be displayed on all modern browsers, no need to download any font, it can also be searched in the database, Zen-Cart's (The open source I used here) default search works fine on it.
I'll be more than happy to help anybody looking for similar implementation.