Hi,
I need to read a UTF8 encoded text file and translate the content to 8-bit.
Using %File class and $ZCVT(TXT,"I","UTF8") works , but I see that if the content is larger than max string (32000) and we cut the content
To max string chunks, we can get a <translate> error if we cut it in the "wrong" point..
Is there a better way to do this task?
My code looks like this:
S file=##class(%File).%New(..LocalFileName)
D file.Open("R")
While 'file.AtEnd {
S Line=$ZCVT(Line,"I","UTF8")
}
D file.Close()
and an example of such an error:
USER>s str=$C(215) USER>w



.png)
712.png)
.png)


