Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

Issue with upside down question mark when writing to a text file

$
0
0

I am using Vs 2012 and writing out data to a text file (in the hl7 format) using the WRITELINE command. If I open the text file in Notepad it looks fine. But if I open it in MS word I see some weird characters at the beginning of the file, including an upside down question mark. This is causing the files to reject when it is sent to the vendor who processes the hl7 messages. Is there a way to modify the code so that these characters do not appear at the beginning of the file?

Here is my code (simplified for this sample):

Dim msg As System.IO.StreamWriter
msg = My.Computer.FileSystem.OpenTextFileWriter(NewMsg, True)
msg.WriteLine(strwithdata)
msg.Close()

This is what I see at the front of the file if I open it in Word:


Viewing all articles
Browse latest Browse all 21115


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>