Search code examples
c#filedxf

Reading dxf file special characters


When I'm reading a TXT file with "special" characters it works perfectly fine. But when I read a DXF file, it translates it to the wrong characters (see image below).

is the iso-8859-1 not the correct encoding for DXF files? R


Solution

  • According to this documentation, DXF files have been written using UTF-8 since DXF R2007. This makes them much more portable than depending on a specific code page.

    That's also the default for File.ReadAllLines, so you can just use File.ReadAllLines(FileName).