Invalid text data when exporting as binary files - text mode

I am creating a file containing data like this.

78,45,New things,200, Number of columns,2.00,5

      

When I open a file in a text panel with a binary type textformat.

0: FF FE 33 00 36 00 2C 80 00 20 30 10 4F 7.8.4.5,4.5,

      

For data, it has a (.) Between two consecutive digits.

0


source to share


1 answer


Your hex view shows the ASCII value for each byte in the file. However, the file appears to be saved as Unicode (it starts with FF FE, which is a Unicode specification). Usually text editors will correctly identify this specification (Notepad does the same as Notepad ++, I'm not familiar with Textpad).

Note that hex viewers are almost universally used. a character representing a byte value that cannot be displayed as an ASCII character (or a character from the OEM user set).

The actual encoding looks like unicode for example. 33 00 and 36 00 are numeric digits, although they represent 36 not 78, so the ASCII representation on the right in your question does not actually match the byte values ​​on the left.



Line: - "78,45, N" when saved as a Litte-endian unicode file will look like hexadecimal: -

FF FE 37 00 38 00 2C 00 34 00 35 00 2C 00 4E 00..7.8., 4.5., N.

Hence, either the content saver is very strange and messes up the encoding, or the Textpad just doesn't handle it correctly (or you're not using the Textpad on the right). Open the file in notepad, does it look ok?

+2


source







All Articles