Is this the right way to do it?



I appreciate this is not a PHP specific question, but I am using PHP to do it, and you're a knowledgeable bunch, so here goes.

I am writing a custom email client to integrate into my application. I use the various imap functions to get message bodies etc.

I am using ajax (xajax to be precise) to display the message body - I populate a div with it.

I can retrieve the character encoding of the message body by using the imap_bodystruct() function.

I then use that character encoding in the header of the ajax output in the content type before outputting the message to the browser.

So far it seems to work fine. Is this the best way to do it? Or would I be better off changing the message body to a different charset?
.



Relevant Pages

  • RE: [PHP] Cannot send a hyperlink
    ... No access to the server command line to install it! ... Why is php refusing to parse as html? ... structure of emails by following the links Daniel Brown sent you a few ... You have things in the message body that should be in the headers. ...
    (php.general)
  • RE: [PHP] Cannot send a hyperlink
    ... It starts to read it as text and not html?? ... [PHP] Cannot send a hyperlink ... You have things in the message body that should be in the headers. ... Checked by AVG Free Edition. ...
    (php.general)
  • RE: [PHP] Cannot send a hyperlink
    ... Php should be able to do this by it's self! ... structure of emails by following the links Daniel Brown sent you a few ... You have things in the message body that should be in the headers. ... Checked by AVG Free Edition. ...
    (php.general)
  • Charset output - is this the correct way?
    ... I use the various php imap functions to get message bodies etc. ... I can retrieve the character encoding of the message body by using the imap_bodystructfunction. ... I then use that character encoding in the header of the ajax output in the content type before outputting the message to the browser. ...
    (comp.lang.javascript)
  • Re: Is this the right way to do it?
    ... I can retrieve the character encoding of the message body by using the imap_bodystructfunction. ... I then use that character encoding in the header of the ajax output in the content type before outputting the message to the browser. ... I just have, but I wonder if anyone has had any experience of using iconvto do a similar thing, and if there's any point, or just let the browser handle it... ...
    (comp.lang.php)