Get the byte of Chinese characters under VB6 and VB.NET, respectively

zhaozj2021-02-16  69

1. Implementation under VB6: DIM STR1 AS STRING

DIM STR2 AS STRING

Str = "Han" 'double-by-string

Dim Array () AS BYTE 'byte array

Arr = strConv (str1, vbfromunicode) 'removes extra bytes into array

Str2 = strconv (array, vbunicode) 'turn back

Second, VB.NET implementation:

DIM STR AS STRING = "Han" DIM Array () as Byte

Array = system.text.Encoding.default.getbytes (STR)

转载请注明原文地址:https://www.9cbs.com/read-14749.html

New Post(0)