Tombor
15th November 2023, 15:26
I need to import text in utf-8 coding where polish characters are(ę,a,ć,ł,ż,ź) and make everything workable without weird characters. I already used utf8.import function and then own function which converts imported text to ascii. Now i need to convert this text back to polish characters, Any ideas? Maybe there is a function wchich makes it straight from imported txt file (utf-8).
mark_h
16th November 2023, 15:25
I would search the whole board for utf-8. I see a lot of threads, but not sure if one of them answers your questions or not.
andreas.toepper
16th November 2023, 15:59
I think, if you are using a modern Infor LN and are using multibyte strings, then you should be able to import (read) a UTF8-textfile into a normal (not multibyte) string and convert it into a multibyte string with the function mentioned above.
This should convert the UTF8 chars into LNs internal TSS format. So, polish chars should be available to display in a field and in a report.
string puffer(PUFFER_MAXLEN) mb
string input.puffer(PUFFER_MAXLEN)
| Read line from file:
err = seq.gets(input.puffer, PUFFER_MAXLEN, file.id)
i = utf8.import(puffer, input.puffer, UTF8_STD_MODE)
This code worked for me.
Btw: I had to change the datatype in my source code. If you pass a multibyte string as a parameter to a function, the parameter must be of type multibyte string too.
Are you trying to export the data into a ASCII based format using a codepage which uses polish characters?
Tombor
20th November 2023, 12:38
Thanks guys for yours replies. I figured out what was wrong, the problem was not defining all the variables storing the string as multibyte string