PxPlus User Forum

Main Board => Discussions => Programming => Topic started by: Alain Stucki on March 10, 2024, 05:19:57 AM

Title: creating UTF-8 text file
Post by: Alain Stucki on March 10, 2024, 05:19:57 AM
Hello. I'm trying to get our product data into a CSV-file and use this to import our data into a webshop. So I OPEN LOCK (7)"datafile.csv" and then I PRINT the requried data into that csv-file.

That works fine. I can open the file with Windows Editor and everything looks good. But when I import the file into the webshop, the accented characters look weird.So the problem is the codepage . The shop requires UTF-8 file format. And the file my little program has created is ANSI. So my questions is: How can I create UTF-8 text files (no BOM) or would I need to use a CLI tool to convert the file from ANSI to UTF-8?

Best regards
Alain Stucki
Title: Re: creating UTF-8 text file
Post by: Allen Miglore on March 10, 2024, 10:43:05 AM
Try cvs(line$,"ansi:utf8").

https://manual.pvxplus.com/PXPLUS/functions/cvsextend.htm
Title: Re: creating UTF-8 text file
Post by: Alain Stucki on March 10, 2024, 04:55:22 PM
 :)
Hello
Thank you sooo much for your fast reply. This works great!