Click here to Skip to main content
15,917,454 members
Home / Discussions / C#
   

C#

 
GeneralRe: Blackjack help needed Pin
Member 395831212-Sep-08 9:15
Member 395831212-Sep-08 9:15 
AnswerRe: Blackjack help needed Pin
Robert.C.Cartaino12-Sep-08 9:31
Robert.C.Cartaino12-Sep-08 9:31 
GeneralRe: Blackjack help needed Pin
Member 395831212-Sep-08 9:51
Member 395831212-Sep-08 9:51 
QuestionError: 'Table' does not contain a definition for 'BorderStyle' Pin
A.Asif12-Sep-08 7:57
A.Asif12-Sep-08 7:57 
AnswerRe: Error: 'Table' does not contain a definition for 'BorderStyle' Pin
Guffa12-Sep-08 8:56
Guffa12-Sep-08 8:56 
GeneralRe: Error: 'Table' does not contain a definition for 'BorderStyle' Pin
A.Asif12-Sep-08 9:30
A.Asif12-Sep-08 9:30 
GeneralRe: Error: 'Table' does not contain a definition for 'BorderStyle' Pin
Dave Kreskowiak12-Sep-08 10:50
mveDave Kreskowiak12-Sep-08 10:50 
QuestionC# How to convert a string from English to Japanese ? Pin
SRogers8812-Sep-08 7:07
SRogers8812-Sep-08 7:07 
Hello,

I no really nothing about unicode. So I am trying to convert a string that starts out in English and convert it to Japanese. This is what I am doing, but I have no idea what to do and nothing is coming out as Japanese. I tried looking on the internet and the best thing I found was this. http://msdn.microsoft.com/en-us/library/system.text.encoding.aspx

But I still can't get it to convert the string. This is what I have for code written so far. Please help. I would expect "This is a Test" to convert to Japanese but it does not.


string TestString = "This is a Test";
Encoding ascii = Encoding.GetEncoding(932);
Encoding japanese = Encoding.GetEncoding(20127);
byte[] unicodeBytes = ascii.GetBytes(TestString);
byte[] JapaneseBytes = Encoding.Convert(ascii, japanese, unicodeBytes);
char[] JapaneseChars = new char[japanese.GetCharCount(JapaneseBytes, 0, JapaneseBytes.Length)];
japanese.GetChars(JapaneseBytes, 0, JapaneseBytes.Length, JapaneseChars, 0);
string JapaneseString = new string(JapaneseChars);



string test = System.Text.Encoding.GetEncoding(932).GetString(JapaneseBytes);

I just tried this and the string is still in English. I am just looking at the string in the debugger to see what it looks like and it is still english.....

modified on Friday, September 12, 2008 1:45 PM

AnswerRe: C# How to convert a string from English to Japanese ? Pin
Guffa12-Sep-08 9:00
Guffa12-Sep-08 9:00 
GeneralRe: C# How to convert a string from English to Japanese ? Pin
SRogers8812-Sep-08 9:14
SRogers8812-Sep-08 9:14 
GeneralRe: C# How to convert a string from English to Japanese ? Pin
Xargo12-Sep-08 9:41
Xargo12-Sep-08 9:41 
GeneralRe: C# How to convert a string from English to Japanese ? Pin
SRogers8812-Sep-08 9:57
SRogers8812-Sep-08 9:57 
GeneralRe: C# How to convert a string from English to Japanese ? Pin
Dave Kreskowiak12-Sep-08 10:42
mveDave Kreskowiak12-Sep-08 10:42 
AnswerRe: C# How to convert a string from English to Japanese ? Pin
Michael Dunn12-Sep-08 11:35
sitebuilderMichael Dunn12-Sep-08 11:35 
QuestionChanging the ownership of files and folders Pin
lane0p212-Sep-08 6:40
lane0p212-Sep-08 6:40 
AnswerRe: Changing the ownership of files and folders Pin
Mbah Dhaim12-Sep-08 7:18
Mbah Dhaim12-Sep-08 7:18 
GeneralRe: Changing the ownership of files and folders Pin
lane0p212-Sep-08 11:32
lane0p212-Sep-08 11:32 
QuestionXML with Inheritance [modified] Pin
Techspoke112-Sep-08 6:35
Techspoke112-Sep-08 6:35 
AnswerRe: XML with Inheritance Pin
Erik Westermann12-Sep-08 10:03
professionalErik Westermann12-Sep-08 10:03 
QuestionMS Access Automation Pin
Jon Henry12-Sep-08 6:19
Jon Henry12-Sep-08 6:19 
AnswerRe: MS Access Automation Pin
Jon Henry12-Sep-08 12:15
Jon Henry12-Sep-08 12:15 
Questionhow can i move the location of gorupbox in winform...? Pin
maifs12-Sep-08 6:08
maifs12-Sep-08 6:08 
AnswerRe: how can i move the location of gorupbox in winform...? Pin
Eslam Afifi12-Sep-08 6:23
Eslam Afifi12-Sep-08 6:23 
AnswerRe: how can i move the location of gorupbox in winform...? Pin
maifs12-Sep-08 9:12
maifs12-Sep-08 9:12 
Questionhow can i change i item's order in listbox in winForm( i have VS2005).. Pin
maifs12-Sep-08 6:06
maifs12-Sep-08 6:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.