Find out encoding of any file [modified]
-
I need to find the encoding of a file that I've opened through code so that I can convert strings to byte arrays using the same encoding. This includes word documents - the one I'm testing is Windows (1252) - according to EditPad, The normal examples that return the variations on UTF8/Unicode are not sufficient. Is there a way to acheive this? In the course of my code I'm opening the documents as byte arrays via a filestream, so some way of extracting the encoding from there would be most useful. Thanks in advance for your help For more information on what I'm actually trying to acheive, see my other post: http://www.codeproject.com/Messages/3303167/Replacing-Bytes-in-an-Office-2003-Word-Document.aspx[^]
modified on Monday, December 14, 2009 9:29 AM
-
I need to find the encoding of a file that I've opened through code so that I can convert strings to byte arrays using the same encoding. This includes word documents - the one I'm testing is Windows (1252) - according to EditPad, The normal examples that return the variations on UTF8/Unicode are not sufficient. Is there a way to acheive this? In the course of my code I'm opening the documents as byte arrays via a filestream, so some way of extracting the encoding from there would be most useful. Thanks in advance for your help For more information on what I'm actually trying to acheive, see my other post: http://www.codeproject.com/Messages/3303167/Replacing-Bytes-in-an-Office-2003-Word-Document.aspx[^]
modified on Monday, December 14, 2009 9:29 AM