Reputation: 2428
My application is used by Japanese clients, supports languages as English/Japanese.
The charset used in our html files are UTF-8.
When we are in Japanese language selected, the input field while entering Numbers, they need to switch off the Hiragana input mode.
Can it be possible to switch off Hiragana specifically for input fields with type="number" or not ?
We are using html, jquery for our application.
Check the difference below which is creating the issue:
Japanese Hiragana mode - @1231231313 English Mode - @1231231313
Upvotes: 1
Views: 1024
Reputation: 522342
You cannot store Japanese characters in a single byte. A single byte allows you a maximum of 256 possible values to be stored, that's nowhere near enough for a full Japanese alphabet. If you need to store arbitrary Japanese text, you need to support an encoding which supports Japanese, which is necessarily going use multiple bytes per character.
If you only need to support a specific subset of Japanese, e.g. only the characters "分時月年" etc, you can make this anything you want by storing some random byte in the database and map that to the character in some standard encoding as necessary. E.g.:
$intoDatabase = str_replace('時', chr(245), $string);
$fromDatabase = str_replace(chr(245), '時', $string);
Just make sure you're not using the byte 245
for other characters.
See UTF-8 all the way through and What Every Programmer Absolutely, Positively Needs To Know About Encodings And Character Sets To Work With Text.
Upvotes: 1