0

I've written a program to write out an automated, delimited invoice file, and it seems to work properly, the file looks correct in notepad. However, when the file is received on the other end, there are a couple of extra characters at the beginning.

The code is basically

fWriter = My.Computer.FileSystem.OpenTextFileWriter(OutputPath)
LineString = 'insert line here
fWriter.WriteLine(LineString)`

the screenshot from the client has a three odd shaped characters at the beginning. They aren't in the input string, and I'm lead to believe it's because the OpenTextFileWriter isn't writing ascii, but it's a flat text file, or it's supposed to be. Any help would be appreciated.

Mary
  • 12,341
  • 3
  • 17
  • 26
  • I don't think the first line of your code will compile. – Mary May 21 '19 at 16:21
  • If want ASCII you have to say so. But why would you want ASCII? – Tom Blodget May 21 '19 at 16:29
  • 1
    https://stackoverflow.com/questions/2223882/whats-the-difference-between-utf-8-and-utf-8-without-bom – jmcilhinney May 21 '19 at 16:31
  • If you want a specific encoding, specify that encoding. Easy to find out how to do that with a search. – jmcilhinney May 21 '19 at 16:34
  • You may find [Create Text File Without BOM](https://stackoverflow.com/q/2502990/1115360) useful. – Andrew Morton May 21 '19 at 17:27
  • @AndrewMorton Yes but that would be wanting to give UTF-8 to a reader that is [non-compliant](https://unicode.org/faq/utf_bom.html#bom5) in not handling a BOM. (Of course, such programs do exist.) That said, text for an invoice might very well be best represented with the Unicode character set, with, for example, the UTF-8 character encoding. – Tom Blodget May 21 '19 at 23:20

0 Answers0