summaryrefslogtreecommitdiff
path: root/glcdgraphics
diff options
context:
space:
mode:
authormrwastl <mrwastl@users.sourceforge.net>2011-06-03 18:33:22 +0200
committermrwastl <mrwastl@users.sourceforge.net>2011-06-03 18:33:22 +0200
commit9cc601b321b3fac05a6657c861cbba6effe55088 (patch)
treea6ae7609ad20455acd3b166ad57f8823c59ef3e8 /glcdgraphics
parent3ce10a1e896258a73e30ad7a17b99a82c286f8c3 (diff)
downloadgraphlcd-base-9cc601b321b3fac05a6657c861cbba6effe55088.tar.gz
graphlcd-base-9cc601b321b3fac05a6657c861cbba6effe55088.tar.bz2
code beautifying, preparations for debugging encodedCharAdjustCounter()
Diffstat (limited to 'glcdgraphics')
-rw-r--r--glcdgraphics/common.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/glcdgraphics/common.c b/glcdgraphics/common.c
index 7bfcc74..8d6e8f6 100644
--- a/glcdgraphics/common.c
+++ b/glcdgraphics/common.c
@@ -10,6 +10,7 @@
*/
#include <ctype.h>
+#include <syslog.h>
#include "common.h"
@@ -58,8 +59,11 @@ std::string trim(const std::string & s)
}
-// character to return when erraneous utf-8 sequence (for now: '_')
-#define UTF8_ERRCODE 0x005F
+// character to return when erraneous utf-8 sequence (for now: space)
+#define UTF8_ERRCODE 0x0020
+// for debugging issues return '_' instead:
+//#define UTF8_ERRCODE 0x005F
+
void encodedCharAdjustCounter(const bool isutf8, const std::string & str, uint32_t & c, unsigned int & i)
{
if (i >= str.length())
@@ -72,7 +76,6 @@ void encodedCharAdjustCounter(const bool isutf8, const std::string & str, uint32
c1 = (i+1 < str.length()) ? str[i+1] : 0;
c2 = (i+2 < str.length()) ? str[i+2] : 0;
c3 = (i+3 < str.length()) ? str[i+3] : 0;
- //c0 &=0xff; c1 &=0xff; c2 &=0xff; c3 &=0xff;
if ( (c0 & 0x80) == 0x00) {
// one byte: 0xxxxxxx