0
Miguel Leeuwe Monday, 26 October 2020 03:17 PM UTC #1

Regretfully you cannot specify the encoding:

From the help on ImportFile (datawindow): "must be ascii" so i guess only ansi is supported?

 

filename

A string whose value is the name of the file from which you want to copy data. The file must be an ASCII, tab-separated file (TXT) or a comma-separated file (CSV), Extensible Markup Language file (XML), or dBase format 2 or 3 file (DBF). Specify the file's full name. If the optional importtype is not specified, the name must end in the appropriate extension.

If filename is an empty string, or if it is null, ImportFile displays the File Open dialog box and allows the user to select a file. The remaining arguments are ignored.

0
Andrew Barnes Monday, 26 October 2020 06:36 PM UTC #2

Miguel's research is surprising given that the PB switched from ASCII strings to Unicode ones several versions back.  You can submit an enhancement request to Appeon.  They may not be able to fulfill it immediately, but if they are aware of it as something that customers are asking for, they may be able to slip it in.

0
Steen Jakobsen Tuesday, 27 October 2020 04:30 PM UTC #3

Thanks for your feedback.

it turns out that PB automatically determine the encoding of ascii / utf8 - very cool.

My problem was and incorrect utf8 header where the BOM was missing. Notepad did however recognise it as UTF8 that was the misleading information that got me to believe that PB had an issue - sorry about that!

So PB rocks once again :-)

 

//Steen

0
Mark Goldsmith Friday, 30 October 2020 04:47 PM UTC #4

Hi Steen,

There was a similar question posted a number of months ago and so I thought I would share it in the event it helps as well.

https://community.appeon.com/index.php/qna/q-a/fileencoding-utf8-file-returns-ansi

Not to repeat all of what was in the numerous replies, but my hope is that Appeon will add the ability to specify on all functions dealing with importing whether or not the file is UTF-8 or UTF-8 with BOM and, better yet, default to assuming a file is UTF-8 even though the BOM is absent versus defaulting to ANSI if the BOM is absent since the former is so much more prevalent today.

Just my thoughts...

Mark