Add support for character encodings

Previous commit added support of it to Csocket.
When encoding is specified, core will convert incoming messages to UTF-8,
and outgoing messages from UTF-8.
When no encoding is specified, it will do nothing to bytes, like before.
This is to be changed somewhere in future, to have UTF-8 on wire by
default too.
When encoding's name starts with *, incoming messages will be treated as
UTF-8, if it is already correct UTF-8. Otherwise, it's converted.

Fix #151
Fix #366
This commit is contained in:
Alexey Sokolov
2013-11-14 08:25:58 +04:00
parent 6012cdee77
commit c0a5ecb40b
9 changed files with 43 additions and 0 deletions

View File

@@ -65,6 +65,7 @@ CIRCSock::CIRCSock(CIRCNetwork* pNetwork) : CZNCSock() {
EnableReadLine();
m_Nick.SetIdent(m_pNetwork->GetIdent());
m_Nick.SetHost(m_pNetwork->GetBindHost());
SetEncoding(m_pNetwork->GetEncoding());
m_uMaxNickLen = 9;
m_uCapPaused = 0;