Click here to Skip to main content
15,888,315 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Form Loading in VB .net Pin
dan!sh 16-Jun-09 5:50
professional dan!sh 16-Jun-09 5:50 
GeneralRe: Form Loading in VB .net Pin
No-e16-Jun-09 6:08
No-e16-Jun-09 6:08 
AnswerRe: Form Loading in VB .net Pin
Henry Minute16-Jun-09 6:41
Henry Minute16-Jun-09 6:41 
GeneralRe: Form Loading in VB .net Pin
No-e16-Jun-09 7:01
No-e16-Jun-09 7:01 
GeneralRe: Form Loading in VB .net Pin
Henry Minute16-Jun-09 7:06
Henry Minute16-Jun-09 7:06 
QuestionConvert a string to unicode Pin
mosche7516-Jun-09 4:17
mosche7516-Jun-09 4:17 
AnswerRe: Convert a string to unicode Pin
Luc Pattyn16-Jun-09 4:54
sitebuilderLuc Pattyn16-Jun-09 4:54 
GeneralRe: Convert a string to unicode Pin
mosche7516-Jun-09 19:45
mosche7516-Jun-09 19:45 
Hi,

I tried this:

Dim asciiString As String = "ÒË╩ßÊÒÃ╩ ╩▀Ýݦ"

Dim [unicode] As Encoding = Encoding.Unicode

Dim en As EncodingInfo() = Encoding.GetEncodings()
For Each ei As EncodingInfo In en
    Dim enc As Encoding = Encoding.GetEncoding(ei.CodePage)

    Dim asciiBytes As Byte() = enc.GetBytes(asciiString)

    Dim unicodeBytes As Byte() = Encoding.Convert(enc, [unicode], asciiBytes)

    Dim unicodeChars([unicode].GetCharCount(unicodeBytes, 0, unicodeBytes.Length) - 1) As Char
    [unicode].GetChars(unicodeBytes, 0, unicodeBytes.Length, unicodeChars, 0)

    Dim unicodeString As New String(unicodeChars)

    Console.WriteLine("Codepage:       {0}", ei.CodePage.ToString())
    Console.WriteLine("Unicode string: {0}", unicodeString)
    Console.WriteLine("")
Next


But no used encoding creates the string I want.
Am I doing anything wrong?

Marco
GeneralRe: Convert a string to unicode Pin
Luc Pattyn16-Jun-09 23:10
sitebuilderLuc Pattyn16-Jun-09 23:10 
Questionxml root Pin
Ebube16-Jun-09 2:43
Ebube16-Jun-09 2:43 
AnswerRe: xml root Pin
EliottA16-Jun-09 2:52
EliottA16-Jun-09 2:52 
GeneralRe: xml root Pin
Luc Pattyn16-Jun-09 3:49
sitebuilderLuc Pattyn16-Jun-09 3:49 
GeneralRe: xml root Pin
Ebube16-Jun-09 5:23
Ebube16-Jun-09 5:23 
GeneralRe: xml root Pin
The Man from U.N.C.L.E.16-Jun-09 7:29
The Man from U.N.C.L.E.16-Jun-09 7:29 
GeneralRe: xml root Pin
Ebube16-Jun-09 23:56
Ebube16-Jun-09 23:56 
GeneralRe: xml root Pin
The Man from U.N.C.L.E.17-Jun-09 1:07
The Man from U.N.C.L.E.17-Jun-09 1:07 
GeneralRe: xml root Pin
Ebube17-Jun-09 2:29
Ebube17-Jun-09 2:29 
QuestionRe: xml root Pin
The Man from U.N.C.L.E.17-Jun-09 4:01
The Man from U.N.C.L.E.17-Jun-09 4:01 
AnswerRe: xml root Pin
Ebube17-Jun-09 6:12
Ebube17-Jun-09 6:12 
Questionhow to beat around shutdown –a Pin
RK11@200915-Jun-09 20:58
RK11@200915-Jun-09 20:58 
AnswerRe: how to beat around shutdown –a Pin
Mithun.Shitole15-Jun-09 21:08
Mithun.Shitole15-Jun-09 21:08 
GeneralRe: how to beat around shutdown –a Pin
RK11@200915-Jun-09 22:26
RK11@200915-Jun-09 22:26 
AnswerRe: how to beat around shutdown –a Pin
Mithun.Shitole15-Jun-09 22:52
Mithun.Shitole15-Jun-09 22:52 
GeneralRe: how to beat around shutdown –a Pin
RK11@200916-Jun-09 1:26
RK11@200916-Jun-09 1:26 
GeneralRe: how to beat around shutdown –a Pin
Mithun.Shitole16-Jun-09 1:34
Mithun.Shitole16-Jun-09 1:34 

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.