alienhunter Active Member Licensed User Longtime User Jan 3, 2016 #1 Hi , i got a file that is unicode , how do i convert this to plain text file to be able to read it with a textreader This file comes form WMIC ( Windows Management Instrumentation Command-line (WMIC)) thanks AH Attachments c325d.txt 512 bytes · Views: 185
Hi , i got a file that is unicode , how do i convert this to plain text file to be able to read it with a textreader This file comes form WMIC ( Windows Management Instrumentation Command-line (WMIC)) thanks AH
Erel B4X founder Staff member Licensed User Longtime User Jan 3, 2016 #2 The question is which encoding is this text file using? It is impossible to say from the text you posted. Have you tried File.ReadString(...) ? Upvote 0
The question is which encoding is this text file using? It is impossible to say from the text you posted. Have you tried File.ReadString(...) ?
alienhunter Active Member Licensed User Longtime User Jan 3, 2016 #3 Hi yes i did they say out in the web this is "All output files are unicode text" Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jan 3, 2016 #4 You can use this code: B4X: Dim b() As Byte = Bit.InputStreamToBytes(File.OpenInput(File.DirAssets, "c325d.txt")) Log(BytesToString(b, 4, b.Length - 4, "UTF-16LE")) 'it skips the 4 BOM bytes. Upvote 0
You can use this code: B4X: Dim b() As Byte = Bit.InputStreamToBytes(File.OpenInput(File.DirAssets, "c325d.txt")) Log(BytesToString(b, 4, b.Length - 4, "UTF-16LE")) 'it skips the 4 BOM bytes.
alienhunter Active Member Licensed User Longtime User Jan 7, 2016 #5 you made my day thank's a lot i have to remember "Bit.InputStreamToBytes" Upvote 0