Thursday 15 August 2013

utf 8 - How to decode string with mixed content (Latin & UTF-8) in PHP -


I have PHP scripts that read emails / usenet messages, I get a case where I have text that Combination of Arabic and amp; The Latin word , i.e.

PHP and ARABIC_WORD

i.e.

PHP and اÙ

The problem is, the text is encoded, ie.

some text =? UTF-8? B? RVBYW 50 CBHMG2 2 KFGHNI 52 LHW NMK2KK = =

My question is I do this ? Utf-8? ... Can decode when it is mixed with Latin text?

I use PHP 5.4.15

form: "=? Charset? Encoding? Encoded text ? = ".

  • Any character can be set with charset . Typically this message will be the same charset as the group.
  • encoding is the same as the "encoding", or "b" encoding encoding.
  • Encoded text is Q-encoded or Base 64-encoded text. Can not be longer than 75 characters with encoded , encoded text , charset , encoded text , and < Em> delimiter If it is desirable to encode more text than fit into 75 characters of encoded-word, multiple encoded-word (separated by CRLFSP) can be used.

    Therefore, it is also a small fraction of Wikipedia that you can decode the string. Sure you are not the first person who needs to do this, so library exists. Also see:



No comments:

Post a Comment