{"id":14113,"date":"2010-05-07T07:00:00","date_gmt":"2010-05-07T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2010\/05\/07\/the-many-ways-of-converting-a-string-from-one-language-to-another\/"},"modified":"2010-05-07T07:00:00","modified_gmt":"2010-05-07T07:00:00","slug":"the-many-ways-of-converting-a-string-from-one-language-to-another","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20100507-00\/?p=14113","title":{"rendered":"The many ways of converting a string from one language to another"},"content":{"rendered":"<p>A customer asked, &#8220;I&#8217;m looking for a way to convert English characters to another language. For example, if the target language is Arabic and the string is the word Hello, I want it to convert to H(Arabic)e(Arabic)l(Arabic)l(Arabic)o(Arabic).&#8221;\n The question is still vague, even with the assistance of the example, since it&#8217;s not clear what &#8220;H(Arabic)&#8221; means.\n There are a variety of ways of converting a string from one language to another. Here are a few I was able to think of.<\/p>\n<ul>\n<li>Translation. For example, converting <i>cat<\/i> to German     would result in <i>Katze<\/i>.     Of course, there are many words with no good direct translation     and others which are ambiguous.     <i>Good-bye<\/i> is normally <i>Auf Wiedersehen<\/i>,     but if you&#8217;re saying good-bye to someone on the telephone, then it&#8217;s     <i>Auf Wiederh&ouml;ren<\/i>.     But at least in that case, even if you get it wrong, the     reader has some idea of what you meant.     Whereas <i>sort<\/i> could be translated as     <i>Art<\/i> (as in <i>What sort of apple is this?<\/i>)     or as <i>ordnen<\/i>     (as in <i>Sort these alphabetically<\/i>),     and if you get the wrong one,     the reader is completely baffled.     (Now, translation is clearly not what was intended here,     but I included it for completeness.) <\/li>\n<li>     <a href=\"http:\/\/blogs.msdn.com\/kierans\/archive\/2008\/12\/15\/by-popular-demand-transliteration-vs-translation.aspx\">     Transliteration<\/a>.     This is an operation most commonly performed between scripts,     such as how the name of the capital of China     &#21271;&#20140;     becomes <i>Beijing<\/i> in English.     The great thing about transliteration systems is that you usually have     <a href=\"http:\/\/www.pinyin.info\/romanization\/compare\/zhuyin.html\">     many to choose from<\/a>.     For example, if you prefer Wade-Giles over Pinyin, then     the capital city would be spelled <i>Pei-Ching<\/i>.     Transliterating to non-alphabetic scripts can be quite a     challenge as well: Everyone is familiar with the story of     Coca-Cola in Chinese.     (<a href=\"https:\/\/channel9.msdn.com\/pdc2008\/PC52\/\">Learn more about Extended Linguistic Services<\/a> from     <a href=\"http:\/\/blogs.msdn.com\/kierans\/archive\/2008\/10\/30\/what-s-new-for-you-in-windows-7-extended-linguistic-services.aspx\">     Kieran Snyder, the long-distance linguist<\/a>.     I considered linking to specific articles until I realized that     I was basically linking to everything,     so here&#8217;s     <a href=\"http:\/\/blogs.msdn.com\/kierans\/\">     the main page<\/a>. Go nuts.) <\/li>\n<li>Phoneticization.     This is similar to transliteration, but spells out the     sounds when you     cannot assume that the reader is familiar with any particular     transliteration system.     The capital of China would be phoneticized as     <a href=\"http:\/\/www.onlyagame.org\/pastshows\/2008\/08\/summer-games-preview-hanging-with-the-us-womens-softball-team-and-living-in-a-judo-house\/#jvflv6\">     <i>bay-jing<\/i><\/a>. <\/li>\n<\/ul>\n<p> As it turns out, the customer wasn&#8217;t interested in any of these!\n What the customer wanted was, &#8220;Take the word Hello and imagine how you would type it on a US-English keyboard. Now change the keyboard layout to Arabic and then press exactly the same keys. That&#8217;s what I want.&#8221; In other words, the customer wanted to see what the result would have been if you had told a blindfolded touch-typist to type <i>Hello<\/i>, but secretly replace the US-English keyboard with an Arabic one.\n Wow, that&#8217;s something that hadn&#8217;t even occurred to me as a possibility.<\/p>\n<p> Fortunately, Michael Kaplan was able to come to the rescue by pointing the customer to the <a href=\"http:\/\/blogs.msdn.com\/michkap\/archive\/2005\/08\/20\/454114.aspx\"> Keyboard Convert Service<\/a>. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>A customer asked, &#8220;I&#8217;m looking for a way to convert English characters to another language. For example, if the target language is Arabic and the string is the word Hello, I want it to convert to H(Arabic)e(Arabic)l(Arabic)l(Arabic)o(Arabic).&#8221; The question is still vague, even with the assistance of the example, since it&#8217;s not clear what &#8220;H(Arabic)&#8221; [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[26],"class_list":["post-14113","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-other"],"acf":[],"blog_post_summary":"<p>A customer asked, &#8220;I&#8217;m looking for a way to convert English characters to another language. For example, if the target language is Arabic and the string is the word Hello, I want it to convert to H(Arabic)e(Arabic)l(Arabic)l(Arabic)o(Arabic).&#8221; The question is still vague, even with the assistance of the example, since it&#8217;s not clear what &#8220;H(Arabic)&#8221; [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/14113","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=14113"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/14113\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=14113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=14113"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=14113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}