diff --git a/src/solvespace.h b/src/solvespace.h index 7e0c68f4..29e227ce 100644 --- a/src/solvespace.h +++ b/src/solvespace.h @@ -275,6 +275,7 @@ public: utf8_iterator& operator++() { **this; p=n; n=NULL; return *this; } utf8_iterator operator++(int) { utf8_iterator t(*this); operator++(); return t; } char32_t operator*(); + const char* ptr() const { return p; } }; class ReadUTF8 { const std::string &str; diff --git a/src/textwin.cpp b/src/textwin.cpp index af461ea4..7a977aca 100644 --- a/src/textwin.cpp +++ b/src/textwin.cpp @@ -445,7 +445,9 @@ void TextWindow::Printf(bool halfLine, const char *fmt, ...) { } } - fmt++; + utf8_iterator it(fmt); + it++; + fmt = it.ptr(); } while(c < MAX_COLS) { meta[r][c].fg = fg;