I am modifying a program that create a positional flat EDI file from a cvs. The input file use UTF-8 as the output must use.
I am facing a problem that writing an UTF-8 string with this code:
Public Function WriteFileBinArray(sString() As Byte, iChannel As Integer) As Boolean
Const kbytCarriageReturn As Byte = 13
Const kbytNewLine As Byte = 10
WriteFileBinArray= False
NumberError = 0
sErrore = ""
Put #iChannel, , sString()
Put #iChannel, , kbytCarriageReturn
Put #iChannel, , kbytNewLine
WriteFileBinArray= True
End Function
The output string, will not have the expected lenght. So the positional flat file will be wrong. As you know better than me, every UTF-8 char is composed by two bytes. I suppose that the problem fall here.
How can i solve my porblem?