tags:

views:

100

answers:

1

I am generating a file which contain the following data like this.

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

When i open the file in textpad with the textformat binary type.

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

In the data part it has (.) between two successive digits.

+1  A: 

Your hex viewer is displaying the ASCII value for each byte in the file. However the file appears to be saved as Unicode (it starts with a FF FE which is a unicode BOM). Ordinarily text editors identify this BOM correctly (Notepad does as does Notepad++, I'm not familiar with Textpad).

Note that hex viewers almost universally use the . character to represent a byte value that can't be rendered as an ASCII character (or character from the users OEM set).

The actual encoding looks like unicode, e.g. 33 00 and 36 00 are numerical digits although they represent 36 not 78 so Ihe ASCII representation on the right in your question doesn't actually match the byte values on the left.

The string:- "78,45,N" when saved as a Litte-endian unicode file would look like this in a hex view:-

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

Therefore either the means of saving the content is very odd and messing up the encoding or Textpad just isn't handling it right (or you're not using Textpad right). Open the file in notepad, does it appear ok?

AnthonyWJones
@Antony I am using Textpad for this... what is the solution for this???
balaweblog
Does the file look ok in notepad?
AnthonyWJones