summaryrefslogtreecommitdiff
path: root/src/sysync/syncsession.cpp
diff options
context:
space:
mode:
authorLukas Zeller <luz@synthesis.ch>2009-10-27 12:45:08 +0100
committerLukas Zeller <luz@synthesis.ch>2009-11-04 17:16:26 +0100
commitcd4fa33d1636c8f7be5ae6d179aa7beb886ddd7e (patch)
tree602df602b633832c8077326df4ecb19fc64ecd87 /src/sysync/syncsession.cpp
parentd4e8239d7fc706a34ed8283489b5a8f9197dbda7 (diff)
MIME-DIR, remote rules: default charset interpretation now UTF-8 (no longer ANSI), added <inputcharset> to override
For some now probably mostly irrelevant devices like T39m, T68 and V3i we had mimo_old interpret strings as ANSI when they had no CHARSET=xxx parameter. This conflicts with newer servers like DeskNow (they send UTF-8, but no CHARSET). So the new default is now UTF-8, but for the server side the new <inputcharset> remote rule option can change that on a per device basis.
Diffstat (limited to 'src/sysync/syncsession.cpp')
-rw-r--r--src/sysync/syncsession.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/sysync/syncsession.cpp b/src/sysync/syncsession.cpp
index 66f9173..64a9b08 100644
--- a/src/sysync/syncsession.cpp
+++ b/src/sysync/syncsession.cpp
@@ -405,7 +405,8 @@ void TRemoteRuleConfig::clear(void)
fTreatCopyAsAdd=-1;
fCompleteFromClientOnly=-1;
fRequestMaxTime=-1; // not defined
- fDefaultOutCharset=chs_unknown; // do not set the charset
+ fDefaultOutCharset=chs_unknown; // do not set the default output charset
+ fDefaultInCharset=chs_unknown; // do not set the default input interpretation charset
// - options that also have a configurable session default
fUpdateClientDuringSlowsync=-1;
fUpdateServerDuringSlowsync=-1;
@@ -489,6 +490,8 @@ bool TRemoteRuleConfig::localStartElement(const char *aElementName, const char *
expectInt32(fRequestMaxTime);
else if (strucmp(aElementName,"outputcharset")==0)
expectEnum(sizeof(fDefaultOutCharset),&fDefaultOutCharset,MIMECharSetNames,numCharSets);
+ else if (strucmp(aElementName,"inputcharset")==0)
+ expectEnum(sizeof(fDefaultInCharset),&fDefaultInCharset,MIMECharSetNames,numCharSets);
else if (strucmp(aElementName,"rejectstatus")==0)
expectUInt16(fRejectStatusCode);
else if (strucmp(aElementName,"forceutc")==0)
@@ -1485,6 +1488,7 @@ void TSyncSession::InternalResetSessionEx(bool terminationCall)
fTreatCopyAsAdd=false;
fStrictExecOrdering=true; // SyncML standard requires strict ordering (of statuses, but this implies execution of commands, too)
fDefaultOutCharset=chs_utf8; // SyncML content is usually UTF-8
+ fDefaultInCharset=chs_utf8; // SyncML content is usually UTF-8
// defaults for possibly remote-dependent behaviour
fCompleteFromClientOnly=getSessionConfig()->fCompleteFromClientOnly; // conform to standard by default
fRequestMaxTime=getSessionConfig()->fRequestMaxTime;
@@ -4350,6 +4354,7 @@ localstatus TSyncSession::checkRemoteSpecifics(SmlDevInfDevInfPtr_t aDevInfP)
if (ruleP->fCompleteFromClientOnly>=0) fCompleteFromClientOnly = ruleP->fCompleteFromClientOnly;
if (ruleP->fRequestMaxTime>=0) fRequestMaxTime = ruleP->fRequestMaxTime;
if (ruleP->fDefaultOutCharset!=chs_unknown) fDefaultOutCharset = ruleP->fDefaultOutCharset;
+ if (ruleP->fDefaultInCharset!=chs_unknown) fDefaultInCharset = ruleP->fDefaultInCharset;
// - eventually override decisions that are otherwise made by session
// Note: this is not a single option because we had this before rule options were tristates.
if (ruleP->fForceUTC>0) fRemoteCanHandleUTC=true;
@@ -4443,6 +4448,7 @@ localstatus TSyncSession::checkRemoteSpecifics(SmlDevInfDevInfPtr_t aDevInfP)
PDEBUGPRINTFX(DBG_HOT+DBG_REMOTEINFO,("- Remote can handle UTC : %s",boolString(fRemoteCanHandleUTC)));
PDEBUGPRINTFX(DBG_HOT+DBG_REMOTEINFO,("- Max Request time [sec] : %ld",static_cast<long>(fRequestMaxTime)));
PDEBUGPRINTFX(DBG_HOT+DBG_REMOTEINFO,("- Content output charset : %s",MIMECharSetNames[fDefaultOutCharset]));
+ PDEBUGPRINTFX(DBG_HOT+DBG_REMOTEINFO,("- Content input charset : %s",MIMECharSetNames[fDefaultInCharset]));
// done
return LOCERR_OK;
} // TSyncSession::checkRemoteSpecifics