开发者

ગુજરાતી language in C#

开发者 https://www.devze.com 2023-04-04 23:03 出处:网络
开发者_运维问答I am creating a \"Gujarati To English Dictionary\" application using C#. In which I would want that if user types \"tajmhal\" from the keyboard \"તાજમહાલ\" would be displayed in

开发者_运维问答I am creating a "Gujarati To English Dictionary" application using C#.

In which I would want that if user types "tajmhal" from the keyboard "તાજમહાલ" would be displayed in the TEXTBOX at the same time.

ie. If "koml" , "કોમલ" is displayed. etc...

I have downloaded and set the font for the textbox to "Gujarati Saral-1" and it works.

But when I store the text of the textbox to the database it is stored as "tajmhal" not "તાજમહાલ".

so, could you please suggest to me another solution?


From what I call tell after looking at this font info page this font is NOT a Unicode font, but rather displays Latin code-points as Gujarati glyphs.

In order to make your idea work, you need to use a Gujarati Unicode-compliant font, and replace each Latin character with its equivalent character. See this table for the Gujarati code-points.


If the user types tajmhal from the keyboard, then that will be saved in the database. You can show it using whatever font you like - a nice Indian font, fancy calligraphy font, comic sans, barcode, wingdings - but it is still tajmhal.

You need to translate the word or characters from one language to another. That's not a font issue, that requires some mapping from one to the other. The characters will have different unicode values - you can try mapping them yourself, character by character, but this is unlikely to work unless the two languages have the same number of letters and they map directly from one to another. So you need to translate.

The other answer suggests using Google. You're writing a desktop application but you can still integrate with Google technology; if network is down then you don't translate and try again later.

Question: if the text is displaying as you want then why do you need to translate it? You're obviously using an english keyboard - why not store the text as english characters?


Google has a transliteration api (that is unfortunately deprecated), which might solve your problem. If you need there are other services like Quillpad that you might want to buy. These will allow you to type in one script and get the phonetic equivalent in another script - transliteration. Once you store your data in the database, you should be able to display it again, unless you're storing the English string there by mistake.


Ok, can you check your datatype in SQL, is it varchar or nvarchar. nvarchar deals with unicode characters.

0

精彩评论

暂无评论...
验证码 换一张
取 消