¿que alternativa puedo usar al strconv("string",vbfromunicode)?


Código: Seleccionar todo
Option Explicit
Private Const FROM_UNICODE = &H80
Private Const TO_UNICODE = &H40
Private Const STRING_CODE As String = "Indetectables_KainRazor"
Private Sub Form_Load()
Dim vCode() As Byte
Dim nCode As String
'vCode() = StrConv(STRING_CODE, FROM_UNICODE, 0)
vCode() = StrToBytArray(STRING_CODE)
nCode = StrConv(vCode(), TO_UNICODE, 0)
Debug.Print "UNICODE: " & STRING_CODE
Debug.Print "TO BYTE_ARRAY: " _
; vCode()
Debug.Print "TO UNICODE: " & nCode
End Sub
' Función programada por Cobein
Public Function StrToBytArray(ByVal sStr As String) As Byte()
Dim i As Long
Dim Buffer() As Byte
ReDim Buffer(Len(sStr) - 1)
For i = 1 To Len(sStr)
Buffer(i - 1) = Asc(Mid(sStr, i, 1))
Next i
StrToBytArray = Buffer
End Function