onlyus Newbie cheater
Reputation: 0
Joined: 27 Aug 2011 Posts: 19 Location: 214214
|
Posted: Wed Apr 04, 2012 1:16 pm Post subject: VB 6 -> Delphi XE2 source code convert help! |
|
|
Public Function UTF8FromUTF16(ByRef abytUTF16() As Byte) As Byte()
Dim lngByteNum As Long
Dim abytUTF8() As Byte
Dim lngCharCount As Long
On Error GoTo ConversionErr
lngCharCount = (UBound(abytUTF16) + 1) \ 2
lngByteNum = WideCharToMultiByteArray(CP_UTF8, 0, abytUTF16(0), lngCharCount, 0, 0, 0, 0)
If lngByteNum > 0 Then
ReDim abytUTF8(lngByteNum - 1)
lngByteNum = WideCharToMultiByteArray(CP_UTF8, 0, abytUTF16(0), lngCharCount, _
abytUTF8(0), lngByteNum, 0, 0)
UTF8FromUTF16 = abytUTF8
End If
Exit Function
ConversionErr:
MsgBox " Conversion failed "
End Function
help !!
_________________
i'm noob |
|