When I convertthefollowing chinese simplified
|
(whose culture name is'
|
zh-Hans' and'How are you?' is its equivalent Englishvalue)value to english it is not convertinginstead it is showing ? ? ? ? ? as output. My code snippet is like follow. string str = " 您好吗?"; byte[] srcByte = Encoding.GetEncoding(936).GetBytes(str); Encoding targetEncoding = Encoding.GetEncoding(1252);
byte[] targetBytes = Encoding.Convert(Encoding.GetEncoding(936), targetEncoding, srcByte); string output = targetEncoding.GetString(targetBytes);
So any one please help me how can I get output as "How are you?" |
| sandiliya |
Code page 1252 is the code page for Western European languages. It is not capable of rendering Chinese characters, question marks are the result. Why are you trying to do this? I hope you are not expecting to use an encoding to translate Chinese into English, that's not going to work.
Hans Passant.- Marked As Answer bynobugzMVP, Moderator19 hours 17 minutes ago
-
|
| nobugz |
I see. So you want to dynamically convert user-entered data from one language to another. First of all, remember to save the language code the user used to type the information. Second, work on a translator. If it is only you programming, maybe it will take some 2 years or so for the first 2 languages. More languages will flow faster as you gain experience and expertise with this translator. If you don't have good command of the involved languages, you'll have to hire someone who does. A second option would be to pay (or use for free?) for the translation services to a third company. I bet Google have something they can provide. Good luck either way. MCP- Proposed As Answer byeryangMSFT, Moderator22 hours 43 minutes ago
- Marked As Answer bynobugzMVP, Moderator19 hours 17 minutes ago
-
|
| webJose |
Not sure what you are expecting but the Encoding will not "translate" simplified chinese into english - it only converts the characters from one characterset to another. |
| Christoph Wagner |
How can I achieve my aboverequirement? Can you suggest any way how to solve the above requirement?
Actually my requiremnt is i want to convert the above chinese word into English. So can you please tell me how to achieve this? |
| sandiliya |
Do you want your output to be "How are you" ? You would have to write your own translator, this cannot be done automatically by the BCL. Look up google translate :). |
| Michal Burger |
Code page 1252 is the code page for Western European languages. It is not capable of rendering Chinese characters, question marks are the result. Why are you trying to do this? I hope you are not expecting to use an encoding to translate Chinese into English, that's not going to work.
Hans Passant.- Marked As Answer bynobugzMVP, Moderator19 hours 17 minutes ago
-
|
| nobugz |
How can weimplement Multilingial supportto Windows application? My application is windows application and for my application we are providing the customization. So in my application we have a setup screen and thereevery user canchange the labels of every fields.
Now we want to provide multilingual feature to my application that means i want to convert all the data to the user selected language and this is dynamic. So how can i solve my requirement? |
| sandiliya |
You will have to translate the application yourself into target languages and allow the user to only select a language that you translated the program into.
|
| Michal Burger |
Read about localization and globalization. Here's an article: http://msdn.microsoft.com/en-us/goglobal/bb688139.aspx. Here's another one: http://msdn.microsoft.com/en-us/magazine/cc163609.aspx Here's a localization example for Windows Installer: http://msdn.microsoft.com/en-us/library/aa367815%28VS.85%29.aspx. This would be the standard way to go.
MCP |
| webJose |
ok. Just consider the following scenario. For example one user 'A' login into my application and now every thing in english and he filled all thefields and submit the form. andI collect all theform data whichhas user entered and save it into database. Now if the user select the langauge as "Chinese" then i must show all his data(which is previously entered and saved in english)in chinese. So in this scenario i must convert all teh words of english to data? and secondly he can enter any type of data into my form. So we can't expect those values.
So how can i achieve the above?
|
| sandiliya |
I want toimplement the multi lingual support to my application and data for my application is dynamic. So how can we provide multi lingual support to dynamic data? |
| sandiliya |
I see. So you want to dynamically convert user-entered data from one language to another. First of all, remember to save the language code the user used to type the information. Second, work on a translator. If it is only you programming, maybe it will take some 2 years or so for the first 2 languages. More languages will flow faster as you gain experience and expertise with this translator. If you don't have good command of the involved languages, you'll have to hire someone who does. A second option would be to pay (or use for free?) for the translation services to a third company. I bet Google have something they can provide. Good luck either way. MCP- Proposed As Answer byeryangMSFT, Moderator22 hours 43 minutes ago
- Marked As Answer bynobugzMVP, Moderator19 hours 17 minutes ago
-
|
| webJose |
Thanks for the reply. Can you provide the names ofany third party companies which provides free service of language translation? |
| sandiliya |
I don't know any. I have never needed one. So far my work goes into English or Spanish, and I have decent command of both. MCP |
| webJose |
Free? Make your project Open Source. With some luck, you might eventually find somebody that is willing to do this kind of work for free. Of course, you won't be paid either. Hans Passant. |
| nobugz |
Hi sandiliya, A previous post is talking about language translation, maybe you will find something there, good luck! http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/0d2f9273-d34a-419f-a656-599d45d3950bThanks, Eric
Please remember to mark helpful replies as answers and unmark them if they provide no help. |
| eryang |