diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 315f94482..90686016f 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -186,7 +186,7 @@ void CTextBox::initVar(void) m_cLineArray.clear(); m_renderMode = 0; - + m_utf8_encoded = true; // max_width = 0; } @@ -652,7 +652,7 @@ void CTextBox::refreshText(void) //TRACE("[CTextBox] %s Line %d m_cFrame.iX %d m_cFrameTextRel.iX %d\r\n", __FUNCTION__, __LINE__, m_cFrame.iX, m_cFrameTextRel.iX); m_pcFontText->RenderString(m_cFrame.iX + m_cFrameTextRel.iX + text_Hborder_width + x_center, y+m_cFrame.iY, m_cFrameTextRel.iWidth, m_cLineArray[i].c_str(), - m_textColor, 0, m_renderMode | Font::IS_UTF8); + m_textColor, 0, m_renderMode | (m_utf8_encoded) ? Font::IS_UTF8 : 0); m_old_cText = m_cText; y += m_nFontTextHeight; } diff --git a/src/gui/widget/textbox.h b/src/gui/widget/textbox.h index 9f8f76172..e65bb1e96 100644 --- a/src/gui/widget/textbox.h +++ b/src/gui/widget/textbox.h @@ -148,6 +148,7 @@ class CTextBox int m_nBgRadiusType; bool m_nPaintBackground; bool m_SaveScreen; + bool m_utf8_encoded; Font* m_pcFontText; int m_nFontTextHeight; @@ -192,6 +193,8 @@ class CTextBox void setWindowMaxDimensions(const int width, const int height); void setWindowMinDimensions(const int width, const int height); void setFontUseDigitHeight(bool set=true); + void enableUTF8(bool enable = true){m_utf8_encoded = enable;} + void disableUTF8(bool enable = false){enableUTF8(false);} inline bool isPainted(void) {if( frameBuffer == NULL) return (false); else return (true);}; inline CBox getWindowsPos(void) {return(m_cFrame);};