diff options
-rw-r--r-- | src/markdown.cpp | 8 | ||||
-rw-r--r-- | src/util.cpp | 10 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/markdown.cpp b/src/markdown.cpp index caf77b5..b99db00 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -109,7 +109,7 @@ static Entry *g_current; static QCString g_fileName; static int g_lineNr; static int g_indentLevel=0; // 0 is outside markdown, -1=page level -static const char g_utf8_nbsp[3] = {'\xc2', '\xa0', '\0'}; // UTF-8 nbsp +static const uchar g_utf8_nbsp[3] = { 0xc2, 0xa0, 0}; // UTF-8 nbsp static const char *g_doxy_nsbp = "&_doxy_nbsp;"; // doxygen escape command for UTF-8 nbsp //---------- @@ -1036,7 +1036,7 @@ static void addStrEscapeUtf8Nbsp(GrowBuf &out,const char *s,int len) } else // escape needed -> slow { - out.addStr(substitute(QCString(s).left(len),g_doxy_nsbp,g_utf8_nbsp)); + out.addStr(substitute(QCString(s).left(len),g_doxy_nsbp,(const char *)g_utf8_nbsp)); } } @@ -2487,8 +2487,8 @@ static QCString detab(const QCString &s,int &refIndent) default: // non-whitespace => update minIndent if (c<0 && i<size) // multibyte sequence { - // special handling of the UTF-8 nbsp character 0xc2 0xa0 - if (c == '\xc2' && data[i] == '\xa0') + // special handling of the UTF-8 nbsp character 0xC2 0xA0 + if ((uchar)c == 0xC2 && (uchar)(data[i]) == 0xA0) { out.addStr(g_doxy_nsbp); i++; diff --git a/src/util.cpp b/src/util.cpp index 28af27b..97d03c5 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -6993,9 +6993,9 @@ bool checkIfTypedef(const Definition *scope,const FileDef *fileScope,const char const char *writeUtf8Char(FTextStream &t,const char *s) { - char c=*s++; - t << c; - if (c<0) // multibyte character + uchar c=(uchar)*s++; + t << (char)c; + if (c>=0x80) // multibyte character { if (((uchar)c&0xE0)==0xC0) { @@ -7025,8 +7025,8 @@ int nextUtf8CharPosition(const QCString &utf8Str,uint len,uint startPos) { int bytes=1; if (startPos>=len) return len; - char c = utf8Str[startPos]; - if (c<0) // multibyte utf-8 character + uchar c = (uchar)utf8Str[startPos]; + if (c>=0x80) // multibyte utf-8 character { if (((uchar)c&0xE0)==0xC0) { |