Hi,
I am saving a sales invoice report using SAVEASHTML in C/AL.
The text in the sales invoice includes characters that include french accented letters, german with umlauts etc. The HTM file when opened through a text editor or opened in a browser looks abolutely fine and all the characters are displayed correctly.
The next stage in my application is to OPEN the HTM file to build an email, streaming in in the usual way and use READTEXT function to read 250 chars at a time. However I found that in my resulting email the accented letters had been misinterpreted. I added the MESSAGE statement shown below and sure enough the READTEXT screws things up.
examples:
“°” converted to “€” by READTEXT
“é” converted to “Ú” by READTEXT
“ç” converted to “Þ” by READTEXT
Has anyone any idea how to resolve this issue? Pleeeez! & Thanks for taking the time to read this!
If you feel inclined try it - create a text file with above examples, then open it withthis code…
vars:
NextLine Text 250
InFile File
Int Integer
FileInStream InStream
Code()
InFile.OPEN(‘C:\MyTest.txt’);
InFile.CREATEINSTREAM(FileInStream);
WHILE NOT (FileInStream.EOS()) DO
BEGIN
Int:= FileInStream.READTEXT(NextLine,250);
MESSAGE(NextLine);
END;