Hi LaVolpe and DrUnicode, the attachment is the test file you want:
Also, hope the following information is useful to you:Code:Public Function CreateBuffer(FileName As String, Buffer As CodePageStruct, _ Caller As ICustEvent, bNoArrayOverlay As Boolean, _ Optional ReleaseOnly As Boolean = False) As Boolean '... '... With Buffer '.Buffer = StrConv(bData(), vbUnicode) ' get code data '--- DreamManor Added 2018-12-23 ------------------------------ .Buffer = StrConv(bData(), vbUnicode, 2052) Dim bTestData() As Byte bTestData() = .Buffer Open "C:\1\Lavolpe.dat" For Binary As #1 Put #1, 1, bTestData() Close #1 Erase bTestData ' *** Note: *** ' Buffer.length -1 = 1731 ' UBound(bTestData) = 3423 '??? '---------------------------------------------------------------- Erase bData() .tSA.cDims = 1 ' nr of dimensions .tSA.cbElements = 2 ' integer .tSA.rgSABlBound = 1 ' one-bound same as string char indexing .tSA.pvData = StrPtr(.Buffer) ' memory address .tSA.rgSABelements = .length + 1 ' number array items .cIndex = 1 .iLTrim = 0: .iRTrim = 0 .FileName = FileName ' overlay array onto the buffer string for faster parsing If bNoArrayOverlay = False Then _ CopyMemory ByVal VarPtrArray(.Bytes), VarPtr(.tSA), 4& End With '... , ...
Len("中") = 1
LenB("中") = 2
Len("abc中")= 4
LenB("abc中")= 8
LenB("abc") = 6
Asc("中") = -10544
Ascw("中")= 20013
The above information is output in the debug(immediate) window.
Merry Christmas and Happy New Year.




Reply With Quote