Extended charset via escapes. DE added to retransmits

This commit is contained in:
Jordan Sherer
2018-07-26 14:31:28 -04:00
parent de66664635
commit 4290dd6e2f
3 changed files with 22 additions and 18 deletions
+8 -4
View File
@@ -124,14 +124,14 @@ QMap<QChar, QString> hufftable = {
{ '\x04' , "110101100010" }, // 1 <- eot
/*
A-Z 0-9 Space . ! ? : + - / \\
A-Z 0-9 Space \\ ? / : - + !
special chars that are escaped will be added here too...
*/
};
/*
original: space + - / ? . ! : \\
needed: ^,&@#$%*()<>'"|={}[];_~`
original: Space \\ ? / : - + !
needed: ^,&@#$%'"()<>|*[]{}=;_~`
*/
QMap<QString, QChar> huffescapes = {
{ "\\ ", '^' },
@@ -161,7 +161,7 @@ QMap<QString, QChar> huffescapes = {
#if 0
// reserved <= 14 bits
{ "\\1", '' },
{ "\\1", '' },
{ "\\2", '' },
{ "\\3", '' },
{ "\\4", '' },
@@ -415,6 +415,10 @@ QString Varicode::huffEscape(QString const &input){
return text;
}
QSet<QChar> Varicode::huffValidChars(){
return QSet<QChar>::fromList(hufftableescaped.keys());
}
bool Varicode::huffShouldEscape(QString const &input){
foreach(auto ch, huffescapes.values()){
if(input.contains(ch)){