I have a pst with STORE_UNICODE_OK bit set. When i open the message i can see the subject as having international characters and is displayed correctly. When i retrieve PR_SUBJECT_A i get ???, the famous non-unicode characters. When i retrieve for PR_SUBJECT_W i get the right unicode characters. Is there a way to find out that i have to query for PR_SUBJECT_W and not for PR_SUBJECT_A. ? TIA
I am not sure what you are asking: you wouldn't know that you have real Unicode until you read PR_SUBJECT_W, but then why would you want to read PR_SUBJECT_A if you already have the real thing? Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "slg" wrote in message news:ecU1g%230hIHA.5208@TK2MSFTNGP04.phx.gbl... >I have a pst with STORE_UNICODE_OK bit set. When i open the message i can >see the subject as having > international characters and is displayed correctly. > > When i retrieve PR_SUBJECT_A i get ???, the famous non-unicode > characters. > When i retrieve for PR_SUBJECT_W i get the right unicode characters. > > Is there a way to find out that i have to query for PR_SUBJECT_W and not > for PR_SUBJECT_A. ? > > TIA > > >
Thx Dimitry. I just mentioned a sample of the situation. I am reading msgs with in a pst and returning their subject either PR_SUBJECT_A or PR_SUBJECT_W . Is it correct to say that we have to read PR_SUBJECT_W if pst has STORE_UNICODE_OK bit set. ? Advise! "Dmitry Streblechenko" wrote in message news:%23OYGri4hIHA.1208@TK2MSFTNGP03.phx.gbl... >I am not sure what you are asking: you wouldn't know that you have real >Unicode until you read PR_SUBJECT_W, but then why would you want to read >PR_SUBJECT_A if you already have the real thing? > > Dmitry Streblechenko (MVP) > http://www.dimastr.com/ > OutlookSpy - Outlook, CDO > and MAPI Developer Tool > > "slg" wrote in message > news:ecU1g%230hIHA.5208@TK2MSFTNGP04.phx.gbl... >>I have a pst with STORE_UNICODE_OK bit set. When i open the message i can >>see the subject as having >> international characters and is displayed correctly. >> >> When i retrieve PR_SUBJECT_A i get ???, the famous non-unicode >> characters. >> When i retrieve for PR_SUBJECT_W i get the right unicode characters. >> >> Is there a way to find out that i have to query for PR_SUBJECT_W and not >> for PR_SUBJECT_A. ? >> >> TIA >> >> >> > >
Depends on what you are trying to do and why. In general, if you always want Unicode data, check the STORE_UNICODE_OK bit. If set, read PR_SUBJECT_W. Otherwise read PR_SUBJECT_A and use the value of PR_INTERNET_CPID to convert the ANSI string to Unicode using MultibyteToWideChar() Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "slg" wrote in message news:OyFCOX6hIHA.536@TK2MSFTNGP06.phx.gbl... > Thx Dimitry. > I just mentioned a sample of the situation. > > I am reading msgs with in a pst and returning their subject either > PR_SUBJECT_A or PR_SUBJECT_W . > Is it correct to say that we have to read PR_SUBJECT_W if pst has > STORE_UNICODE_OK bit set. ? > Advise! > > > > "Dmitry Streblechenko" wrote in message > news:%23OYGri4hIHA.1208@TK2MSFTNGP03.phx.gbl... >>I am not sure what you are asking: you wouldn't know that you have real >>Unicode until you read PR_SUBJECT_W, but then why would you want to read >>PR_SUBJECT_A if you already have the real thing? >> >> Dmitry Streblechenko (MVP) >> http://www.dimastr.com/ >> OutlookSpy - Outlook, CDO >> and MAPI Developer Tool >> >> "slg" wrote in message >> news:ecU1g%230hIHA.5208@TK2MSFTNGP04.phx.gbl... >>>I have a pst with STORE_UNICODE_OK bit set. When i open the message i >>>can see the subject as having >>> international characters and is displayed correctly. >>> >>> When i retrieve PR_SUBJECT_A i get ???, the famous non-unicode >>> characters. >>> When i retrieve for PR_SUBJECT_W i get the right unicode characters. >>> >>> Is there a way to find out that i have to query for PR_SUBJECT_W and not >>> for PR_SUBJECT_A. ? >>> >>> TIA >>> >>> >>> >> >> >
Thx a lot!! "Dmitry Streblechenko" wrote in message news:eGm2IEFiIHA.1212@TK2MSFTNGP05.phx.gbl... > Depends on what you are trying to do and why. > In general, if you always want Unicode data, check the STORE_UNICODE_OK > bit. If set, read PR_SUBJECT_W. Otherwise read PR_SUBJECT_A and use the > value of PR_INTERNET_CPID to convert the ANSI string to Unicode using > MultibyteToWideChar() > > Dmitry Streblechenko (MVP) > http://www.dimastr.com/ > OutlookSpy - Outlook, CDO > and MAPI Developer Tool > > "slg" wrote in message > news:OyFCOX6hIHA.536@TK2MSFTNGP06.phx.gbl... >> Thx Dimitry. >> I just mentioned a sample of the situation. >> >> I am reading msgs with in a pst and returning their subject either >> PR_SUBJECT_A or PR_SUBJECT_W . >> Is it correct to say that we have to read PR_SUBJECT_W if pst has >> STORE_UNICODE_OK bit set. ? >> Advise! >> >> >> >> "Dmitry Streblechenko" wrote in message >> news:%23OYGri4hIHA.1208@TK2MSFTNGP03.phx.gbl... >>>I am not sure what you are asking: you wouldn't know that you have real >>>Unicode until you read PR_SUBJECT_W, but then why would you want to read >>>PR_SUBJECT_A if you already have the real thing? >>> >>> Dmitry Streblechenko (MVP) >>> http://www.dimastr.com/ >>> OutlookSpy - Outlook, CDO >>> and MAPI Developer Tool >>> >>> "slg" wrote in message >>> news:ecU1g%230hIHA.5208@TK2MSFTNGP04.phx.gbl... >>>>I have a pst with STORE_UNICODE_OK bit set. When i open the message i >>>>can see the subject as having >>>> international characters and is displayed correctly. >>>> >>>> When i retrieve PR_SUBJECT_A i get ???, the famous non-unicode >>>> characters. >>>> When i retrieve for PR_SUBJECT_W i get the right unicode characters. >>>> >>>> Is there a way to find out that i have to query for PR_SUBJECT_W and >>>> not for PR_SUBJECT_A. ? >>>> >>>> TIA >>>> >>>> >>>> >>> >>> >> > >