PC Review


Reply
Thread Tools Rate Thread

Can't decode Unicode to OEM

 
 
Just Me
Guest
Posts: n/a
 
      25th Mar 2005
I copy some text from a DOS window to the clipboard

Then run this

But both messageboxes show the same (incorrect) symbols

Incorrect in that they do not agree with what shows in DOS

See anything wrong???





Dim bDataO As DataObject = Clipboard.GetDataObject()

If bDataO.GetDataPresent(DataFormats.OemText, False) Then

Dim str As String = CType(bDataO.GetData(DataFormats.OemText, False),
String)

MessageBox.Show(str)

Dim lOutEncoding As Encoding = Encoding.GetEncoding(437)

Dim linEncoding As Encoding = Encoding.Unicode

Dim lStrAsBytes As Byte() = linEncoding.GetBytes(str)

Dim lOutEncodingBytes As Byte() = Encoding.Convert(linEncoding,
lOutEncoding, lStrAsBytes)

Dim lOutEncodingChars() As Char = lOutEncoding.GetChars(lOutEncodingBytes)

GetCodePageString = New String(lOutEncodingChars)

MessageBox.Show(GetCodePageString)


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
unicode? non-unicode? Is Outlook 2003 obsolete software? Bert_Bert Microsoft Outlook VBA Programming 6 30th Jul 2008 02:09 PM
Outlook 2003--How can I switch between unicode and non-unicode mode? Steve A. Microsoft Outlook 1 20th Jul 2004 03:40 PM
about Unicode and decode-encode Anders Both Microsoft C# .NET 1 4th Feb 2004 10:48 PM
How can I decode the unicode?? that is very exigency qushui_chen Microsoft C# .NET 3 19th Aug 2003 10:55 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:16 AM.