0

I'm trying to convert input strings to UTF-8 using PHP. I know that mbstring() and iconv() can do it, but my problem is when the string's encoding is not supported by mbstring(). For example the Windows-1256 encoding!

I had found a way to fix this problem because I know the binary representation of that encoding, but my question is how to get the byte representation of a given non-ASCII string?

tar
  • 1,538
  • 1
  • 20
  • 33
Ashnet
  • 404
  • 5
  • 5
  • Thanks alot, but the big problem is how to detect that the string is win 1256? such as php function dont support win 1256 encoding!! for this im trying to creat my own function for genaral detection of encoding, this function will use bits representation to find encoding!! Thnks. – Ashnet Jun 10 '13 at 13:13

1 Answers1

0

You can get a hex dump of your string using bin2hex function.

This answer may also be helpful.

Community
  • 1
  • 1
nstCactus
  • 5,141
  • 2
  • 30
  • 41