ipsservices/ipssosplugin/src/ipsplgsmtpservice.cpp
changeset 4 e7aa27f58ae1
parent 0 8466d47a6819
child 8 e1b6206813b4
--- a/ipsservices/ipssosplugin/src/ipsplgsmtpservice.cpp	Tue Jan 26 11:45:42 2010 +0200
+++ b/ipsservices/ipssosplugin/src/ipsplgsmtpservice.cpp	Tue Feb 02 00:02:40 2010 +0200
@@ -19,6 +19,9 @@
 #include "emailtrace.h"
 #include "ipsplgheaders.h"
 
+#include <featmgr.h>
+#include <bldvariant.hrh> // for feature definitions
+
 // <cmail> const TInt KIpsSetUtilsCharAt = '@'; </cmail>
 const TInt KIpsSetUtilsCharLessThan = '<';
 const TInt KIpsSetUtilsCharMoreThan = '>';
@@ -48,6 +51,11 @@
     {
     FUNC_LOG;
     delete iMsgMapper;
+    
+    if( iFeatureManagerInitialized )
+    	{
+    	FeatureManager::UnInitializeLib();  
+    	}
     }    
 
 // ---------------------------------------------------------------------------
@@ -89,6 +97,9 @@
     {
     FUNC_LOG;
     iMsgMapper = CIpsPlgMsgMapper::NewL( iSession, iPlugin );
+    
+    FeatureManager::InitializeLibL();
+    iFeatureManagerInitialized = ETrue;
     }
 
 // ---------------------------------------------------------------------------
@@ -523,10 +534,44 @@
     {
     FUNC_LOG;
 
+    
+   
+    // tp teleca change for korean specific email encoding
     // Default charset
     TUid charset;
     charset.iUid = KCharacterSetIdentifierUtf8;
 
+      // korea specific charset
+      if ( FeatureManager::FeatureSupported( KFeatureIdKorean ))
+      {
+      
+      //const TUid KCRUidEMailCharsets = {0x20018441};    // korea needs different default charset
+          const TInt KoreanMib = 36; // magic number to read from cen rep would be better
+            
+		  CCnvCharacterSetConverter* charConv = NULL;
+		  TRAPD( err, charConv = CCnvCharacterSetConverter::NewL() );
+		  if( err == KErrNone )
+			  {
+			  TUint characterSetId = KCharacterSetIdentifierUtf8;
+			  RFs fs;
+			  TInt err = fs.Connect();
+			  
+			  if( err == KErrNone )
+				  {
+				  TRAP( err, characterSetId = charConv->ConvertMibEnumOfCharacterSetToIdentifierL( KoreanMib, fs ));
+				   if( err == KErrNone )
+					   { // set korean specific charset
+					   charset = TUid::Uid( characterSetId );
+					   }
+				   fs.Close();
+				  }
+			  }
+
+         delete charConv; 
+     
+      }
+      // tp teleca change END
+
     // set in preparation flag, altought 
     // not known where this affects
     TMsvId dummy;