Skip to content

Instantly share code, notes, and snippets.

@ioseb
Created June 14, 2012 13:28
Show Gist options
  • Save ioseb/2930285 to your computer and use it in GitHub Desktop.
Save ioseb/2930285 to your computer and use it in GitHub Desktop.
function convertToKA(input) {
var chars = {
"a": "ა",
"b": "ბ",
"g": "გ",
"d": "დ",
"e": "ე",
"v": "ვ",
"z": "ზ",
"T": "თ",
"i": "ი",
"k": "კ",
"l": "ლ",
"m": "მ",
"n": "ნ",
"o": "ო",
"p": "პ",
"J": "ჟ",
"r": "რ",
"s": "ს",
"t": "ტ",
"u": "უ",
"f": "ფ",
"q": "ქ",
"R": "ღ",
"y": "ყ",
"S": "შ",
"C": "ჩ",
"c": "ც",
"Z": "ძ",
"w": "წ",
"W": "ჭ",
"x": "ხ",
"j": "ჯ",
"h": "ჰ"
};
var result = [];
for (var i = 0; i < input.length; i++) {
result.push(chars[input[i]] || input[i]);
}
return result.join('');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment