Page 1 of 1

how to check which text encoding is used using php

Posted: Sat Dec 27, 2008 11:04 am
by ptrckgorman
Dear all,
i have a text file which contain some text in a encoded format. how to decode the text and how to check which encoding is used for that text.

the text in my text file is in the from
text = 050003000302004A0048004A004D004A006B006A0047004A0 04D004A0048004A004D004A0047004A004D0047004A004D00 4A0047004A0047004A004D004A004E004A0047004A004D004 A0047004A004D006A0067006A00610067004D004A0047004A 006A006D006A002E002C0027003F00210022002D002800290 040002F003A005F003B002B00260025002A
is there any way to decode it to a normal text message

Re: how to check which text encoding is used using php

Posted: Sat Dec 27, 2008 11:36 am
by watson516
Have you tryed mb_detect_encoding? This seems to check the encoding of a file.

Re: how to check which text encoding is used using php

Posted: Sat Dec 27, 2008 1:13 pm
by Mark Baker
watson516 wrote:Have you tryed mb_detect_encoding?
mb_detect_encoding() isn't particularly useful, because it can return a lot of false positives.

Nor does the listed sample text appear to be any standard encoding for web pages.
It looks more like a set of hex values, most of which correspond to ASCII control characters.

To try and identify the coding, we need a lot more informationabout the file, what generated it, is it numeric or text data, etc.