From e398fdf94e12f4d353987fcf1b8185305d2e3e04 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Sun, 27 Jan 2019 09:14:45 -0500 Subject: [PATCH] allow single char utf8 hooks --- GUI/misc.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/GUI/misc.cpp b/GUI/misc.cpp index db18fa2..a7ab1ee 100644 --- a/GUI/misc.cpp +++ b/GUI/misc.cpp @@ -183,11 +183,15 @@ namespace QString RCode = "R"; QTextStream codeBuilder(&RCode); - if (hp.type & USING_UNICODE) codeBuilder << "Q"; - else if (hp.type & USING_UTF8) codeBuilder << "V"; - else codeBuilder << "S"; - - if (hp.codepage != 0 && hp.codepage != CP_UTF8) codeBuilder << hp.codepage << "#"; + if (hp.type & USING_UNICODE) + { + codeBuilder << "Q"; + } + else + { + codeBuilder << "S"; + if (hp.codepage != 0) codeBuilder << hp.codepage << "#"; + } codeBuilder.setIntegerBase(16); codeBuilder.setNumberFlags(QTextStream::UppercaseDigits); @@ -211,14 +215,14 @@ namespace } else { - if (hp.type & USING_UTF8) codeBuilder << "V"; - else if (hp.type & USING_STRING) codeBuilder << "S"; + if (hp.type & USING_STRING) codeBuilder << "S"; else if (hp.type & BIG_ENDIAN) codeBuilder << "A"; else codeBuilder << "B"; } if (hp.type & NO_CONTEXT) codeBuilder << "N"; + if (hp.text_fun || hp.filter_fun || hp.hook_fun) codeBuilder << "X"; // no AGTH equivalent - if (hp.codepage != 0 && hp.codepage != CP_UTF8) codeBuilder << hp.codepage << "#"; + if (hp.codepage != 0 && !(hp.type & USING_UNICODE)) codeBuilder << hp.codepage << "#"; codeBuilder.setIntegerBase(16); codeBuilder.setNumberFlags(QTextStream::UppercaseDigits); @@ -226,7 +230,6 @@ namespace if (hp.offset < 0) hp.offset += 4; if (hp.split < 0) hp.split += 4; - if (hp.text_fun || hp.filter_fun || hp.hook_fun) codeBuilder << "X"; // no AGTH equivalent codeBuilder << hp.offset; if (hp.type & DATA_INDIRECT) codeBuilder << "*" << hp.index; if (hp.type & USING_SPLIT) codeBuilder << ":" << hp.split;