views:

1370

answers:

4

how to use unicode available in vb6 in vb.net?? is there ny equivalent of vb6 unicode in vb.net??

A: 

VB 6 did not support Unicode, at least not directly. There were ways around it, but it was a royal pain in the rear. If you are asking does VB 6 support unicode like VB.NET, the answer is no.

If, instead, you are asking whether or not you can use something like code pages in VB.NET, the answer is an indirect yes, although I see no reason to jump through that hoop to support globalization/localization, as the paradigm has shifted.

Gregory A Beamer
VB6 strings were Unicode. However, it's true that VB6' Forms library didn't support Unicode and that there was no library to work with advanced Unicode features beyond the simple storage and retrieval of UTF-16 BMP characters.
Konrad Rudolph
To add some more to Konrad's comment. The full story of VB6's partial support for Unicode is explained in this document by Michael Kaplan: http://www.i18nwithvb.com/chapters/Chapter06_en.htm
MarkJ
+1  A: 

All strings in .NET (and hence in VB.NET) are unicode. .NET also has libraries to output strings in different formats (see the System.Text.Encoding class and related classes). What exactly are you trying to do with unicode?

Chris Hynes
i hv upgraded my project from vb to vb.net.i m getting the following problem:'UPGRADE_ISSUE: Constant vbUnicode was not upgraded. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup2070"' code is also there..plz hv a luk..see if u can help..
this is the line of code.... sPixel = IIf(mvarEncodeASCII85, ToASCII85(ImgBuf), DecodeString(System.Text.Encoding.UTF8.GetString(ImgBuf)))
Looks valid to me. Does it build and run? Right now looks like its decoding UTF8, but if you want Unicode proper, change that Encoding.UTF8 to Encoding.Unicode. Basically, what Jared said.
Chris Hynes
A: 

Are you using vbUnicode in order to convert a Byte Array to a String? Like the following?

StrConv(ByteArray, vbUnicode)

If so this is the .Net equivalent of that function

Dim theString as String = System.Text.Encoding.Unicode.GetString(ByteArray)
JaredPar
A: 

i hv used the following lines of code...

sPixel = IIf(mvarEncodeASCII85, ToASCII85(ImgBuf), DecodeString(System.Text.Encoding.Unicode.GetString(ImgBuf)))

it is still not showing the image...just displaying a black rect.. wat to do???