none
How do Microsoft Outlook handle characters in "From Field" of email which are encoded in Quoted Printable? RRS feed

  • Question

  • Hi,

    How to Decode quoted printable encoded characters in "From Field" of an email. I am using IconverterSession to convert MIME to MAPI.

    example:

    From Field has this name "María Buitrago" with diacritical marks. which is encoded and displayed as 

    From: =?Windows-1252?Q?Mar=EDa_Buitrago?= 

    I would be very grateful if someone could help me out to decode the  character while converting from MIME to MAPI.

    Thanks,

    Thopulou                 


    thopulou Associate Software Engineer

    Wednesday, January 24, 2018 10:36 AM

Answers

All replies

  • IConverterSession will handle that for you. Are you saying it does not work properly?


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, January 24, 2018 4:56 PM
  • Yes Dmitry i am using IConverterSession and it is not working properly.  Do i need to set some flag so that it will decode the email header like From,To,CC and Subject.

    Here is the header of an email where From,CC,Subject have Diacritical marks(french characters) and IConverterSession decode properly CC and Subject. But "From" field is not decoded properly. The issue is only with From Field.

    From: =?Windows-1252?Q?Mar=EDa_Buitrago?= <maria.buitrago@ppulegal.com>
    To: Andrea Concha <andrea.concha@ppulegal.com>, Carolina Rozo
    <carolina.rozo@ppulegal.com>
    CC:
    =?Windows-1252?Q?=27PAULA_CABALLERO_G=D3MEZ_=5F_IMPLEMENTACI=D3N_Correspo?=
     =?Windows-1252?Q?ndencia=27?= <{F587656}.Imanage@wcs.pgclaw.loc>
    Subject:
     =?Windows-1252?Q?RE:_RE:_Pregunta-_Trust_Beneficiario_de_una_Fundaci=F3n_?=
     =?Windows-1252?Q?de_Inter=E9s_Privado_[IWOV-Imanage.FID587656]?=

    attached image is how IConverterSession does after converting to MAPI


    thopulou Associate Software Engineer

    Wednesday, January 24, 2018 7:59 PM
  • If I create an EML file with the following content and import it in OutlookSpy (click IConverterSession | MIMEToMAPI), I can see the message just fine.

    From: =?Windows-1252?Q?Mar=EDa_Buitrago?= <maria.buitrago@ppulegal.com>
    To: Andrea Concha <andrea.concha@ppulegal.com>, Carolina Rozo
    <carolina.rozo@ppulegal.com>
    CC:
    =?Windows-1252?Q?=27PAULA_CABALLERO_G=D3MEZ_=5F_IMPLEMENTACI=D3N_Correspo?=
     =?Windows-1252?Q?ndencia=27?= <{F587656}.Imanage@wcs.pgclaw.loc>
    Subject:
     =?Windows-1252?Q?RE:_RE:_Pregunta-_Trust_Beneficiario_de_una_Fundaci=F3n_?=
     =?Windows-1252?Q?de_Inter=E9s_Privado_[IWOV-Imanage.FID587656]?=
    attached image is how IConverterSession does after converting to MAPI

    test


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!


    Wednesday, January 24, 2018 9:53 PM
  • Hi Dmitry,

    I found that it is not because of IConvererSession.

    The problem happen because they are writing Unicode Signature(BOM) to eml file before converting to msg.

    Is it necessary to write BOM to EML file before Conversion?

    this is how they did

    DWORD dwBytesWritten = -1;
    if (0 == _stricmp(sEncoding, "UTF-8"))
    {
    // Write UTF-8 BOM
    unsigned char sUtf8BOM[3] = {0xEF, 0xBB, 0xBF};
    if (!WriteFile(hEMLFile, sUtf8BOM, 3, &dwBytesWritten, NULL))
    {
    break; 

    }

    thanks,

    Thopulou



    thopulou Associate Software Engineer

    Monday, January 29, 2018 6:32 AM
  • Absolutely not - BOM signature is only for the txt files, not EML.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    • Marked as answer by D thopulou Monday, January 29, 2018 3:36 PM
    Monday, January 29, 2018 1:12 PM
  • Hi,

    Dmitry thank you so much for the answer. Programming in outlook is much easier because of your help.

    Thanks,

    Thopulou


    thopulou Associate Software Engineer

    Monday, January 29, 2018 3:37 PM