Last post Oct 10, 2016 05:56 PM by KathyW
Oct 07, 2016 10:09 AM|westgatezagreb|LINK
I need to import csv as UTF8 (originaly it is in ANSI)
I tried Dim fileStream As StreamReader = New StreamReader(fileIn, Encoding.UTF8, True)
But stll wrong charters are dislayed (�)
If I use UTF7 I get (è)
If I open file in notepad and resave it in UTF it reads normaly.
Oct 07, 2016 03:18 PM|Eric Du|LINK
Oct 07, 2016 03:23 PM|westgatezagreb|LINK
Oct 07, 2016 03:57 PM|KathyW|LINK
Refer to the following: https://blogs.msdn.microsoft.com/buckh/2004/05/18/converting-a-text-file-from-one-encoding-to-another/
The main point is that: "The .NET runtime uses
Unicode as the encoding for all strings. The
StreamWriter classes in
System.IO take an
Encoding as a parameter. So, to convert from one encoding to another,
we just need to specify the original encoding and read the file contents into a string followed by writing out the string in the desired encoding."
Oct 10, 2016 08:12 AM|westgatezagreb|LINK
I tried that as well but it does not help, at the end I used replace to change 4 charters from.... not so good solution but resault is what I need...
Oct 10, 2016 05:56 PM|KathyW|LINK
What was the exact code that you tried?