How to interpret binary content, .dat?

0

I need to interpret .dat files, for example. I suppose this is the content of it:

³Å¸ÎÔ| ,

being equivalent to "Davis" as a text.

In JavaScript, using XMLHttpRequest to a .dat file should respond with the text "Davis", but it does not interpret this.

How can I interpret this complex content with my code in steps?

    
asked by anonymous 07.03.2016 / 00:47

1 answer

3

There's no way without knowing which encoding was used to generate this file.

.dat is often used to say that this is a binary file in a format that only the program that created it understands.

This type of file has been falling into disuse in favor of self-descriptive alternatives, in order to separate the representation of the data of the program that uses the data. You probably know XML and JSON-- they came up to solve that kind of problem.

The way you are now is to look at the documentation provided by those who are giving you this data to understand how they are structured before proceeding.

    
07.03.2016 / 01:30