Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Japanese characters :Convert lowerCase to upperCase using jquery

I tried using toUppercase() method to convert japanese characters to uppercase but it return same string with out conversion.

Is there any other way to do this using jquery or javascript.

fieldValue = "ショウコ";              //japanese string.

function convertToUppercase(fieldValue)
{      
 convertedValue = fieldValue.toUpperCase();
 return convertedValue;
}

Any help would be greatly appreciated!

like image 879
Swathi Avatar asked Sep 26 '12 18:09

Swathi


2 Answers

There's a list of all the "small" letters (known as "youon") on Wikipedia:

ぁぃぅぇぉっゃゅょゎァィゥェォヵㇰヶㇱㇲッㇳㇴㇵㇶㇷㇷ゚ㇸㇹㇺャュョㇻㇼㇽㇾㇿヮ

You could use a switch statement to convert them to their "big" equivalents, which I'll type out here for your convenience:

あいうえおつやゆよわアイウエオカクケシスツトヌハヒフプヘホムヤユヨラリルレロワ

Note that the consonants aren't necessarily read the same way when they're made "big"; for example, 何ヶ月 is read "なんかげつ(nankagetsu)", not "なんけげつ(nankegetsu)". っ, which indicates a glottal stop on the next syllable, is read as "tsu" when it's made big.

The "big" vowels indicate that they need to be given their own syllable length. (There's a term for this too, but I'm not a linguist -- sorry!)

like image 148
Rei Miyasaka Avatar answered Oct 31 '22 08:10

Rei Miyasaka


I'm a bit ignorant on the names of Japanese characters but I do know that Sugar.js has many methods for manipulating and transforming such characters. It has methods such as zenkaku, hankaku, hiragana, and katakana.

Here's a link to the Sugarjs' String API

like image 44
richoffrails Avatar answered Oct 31 '22 08:10

richoffrails