summaryrefslogtreecommitdiff
path: root/glcdgraphics/common.h
diff options
context:
space:
mode:
authormrwastl <mrwastl@users.sourceforge.net>2011-06-04 18:03:06 +0200
committermrwastl <mrwastl@users.sourceforge.net>2011-06-04 18:03:06 +0200
commit77e60a658e3f6a9a2fecbafee484f1c5efca6577 (patch)
tree885457ced91f1b1802154aac39db63f87fdc7203 /glcdgraphics/common.h
parentf55d4bed0d3c14e4c537ee2b103b465b84b6d955 (diff)
downloadgraphlcd-base-77e60a658e3f6a9a2fecbafee484f1c5efca6577.tar.gz
graphlcd-base-77e60a658e3f6a9a2fecbafee484f1c5efca6577.tar.bz2
skins are now UTF8 per definition, on non UTF-8 systems text-data will be converted automatically; additional optional error character in encodedCharAdjustCounter(), encodedCharAdjustCounter() now returns success; code cleanups
Diffstat (limited to 'glcdgraphics/common.h')
-rw-r--r--glcdgraphics/common.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/glcdgraphics/common.h b/glcdgraphics/common.h
index 0043390..f0376bf 100644
--- a/glcdgraphics/common.h
+++ b/glcdgraphics/common.h
@@ -15,13 +15,19 @@
#include <string>
#include <stdint.h>
+// character to return when erraneous utf-8 sequence (for now: space)
+//#define UTF8_ERRCHAR 0x0020
+// for debugging issues return '_' instead:
+#define UTF8_ERRCHAR 0x005F
+
+
namespace GLCD
{
void clip(int & value, int min, int max);
void sort(int & value1, int & value2);
std::string trim(const std::string & s);
-void encodedCharAdjustCounter(const bool isutf8, const std::string & str, uint32_t & c, unsigned int & i);
+bool encodedCharAdjustCounter(const bool isutf8, const std::string & str, uint32_t & c, unsigned int & i, const uint32_t errChar = UTF8_ERRCHAR);
} // end of namespace