diff --git a/nel/include/nel/gui/css_parser.h b/nel/include/nel/gui/css_parser.h index a6dc92022..65b6a11b0 100644 --- a/nel/include/nel/gui/css_parser.h +++ b/nel/include/nel/gui/css_parser.h @@ -38,7 +38,7 @@ namespace NLGUI private: // stylesheet currently parsed - ucstring _Style; + std::string _Style; // keep track of current position in _Style size_t _Position; @@ -70,49 +70,49 @@ namespace NLGUI void preprocess(); // parse selectors + combinators - std::vector parse_selector(const ucstring &sel, std::string &pseudoElement) const; + std::vector parse_selector(const std::string &sel, std::string &pseudoElement) const; // parse selector and style - void parseRule(const ucstring &selectorString, const ucstring &styleString); + void parseRule(const std::string &selectorString, const std::string &styleString); inline bool is_eof() const { return _Position >= _Style.size(); } - inline bool is_whitespace(ucchar ch) const + inline bool is_whitespace(char ch) const { - return (ch == (ucchar)' ' || ch == (ucchar)'\t' || ch == (ucchar)'\n'); + return (ch == ' ' || ch == '\t' || ch == '\n'); } - inline bool is_hex(ucchar ch) const + inline bool is_hex(char ch) const { - return ((ch >= (ucchar)'0' && ch <= (ucchar)'9') || - (ch >= (ucchar)'a' && ch <= (ucchar)'f') || - (ch >= (ucchar)'A' && ch <= (ucchar)'F')); + return ((ch >= '0' && ch <= '9') || + (ch >= 'a' && ch <= 'f') || + (ch >= 'A' && ch <= 'F')); } inline bool maybe_escape() const { // escaping newline (\n) only allowed inside strings - return (_Style.size() - _Position) >= 1 && _Style[_Position] == (ucchar)'\\' && _Style[_Position+1] != '\n'; + return (_Style.size() - _Position) >= 1 && _Style[_Position] == '\\' && _Style[_Position+1] != '\n'; } - inline bool is_quote(ucchar ch) const + inline bool is_quote(char ch) const { - return ch== (ucchar)'"' || ch == (ucchar)'\''; + return ch== '"' || ch == '\''; } - inline bool is_block_open(ucchar ch) const + inline bool is_block_open(char ch) const { - return ch == (ucchar)'{' || ch == (ucchar)'[' || ch == (ucchar)'('; + return ch == (char)'{' || ch == (char)'[' || ch == (char)'('; } - inline bool is_block_close(ucchar ch, ucchar open) const + inline bool is_block_close(char ch, char open) const { - return ((open == '{' && ch == (ucchar)'}') || - (open == '[' && ch == (ucchar)']') || - (open == '(' && ch == (ucchar)')')); + return ((open == '{' && ch == (char)'}') || + (open == '[' && ch == (char)']') || + (open == '(' && ch == (char)')')); } inline bool is_comment_open() const @@ -120,25 +120,25 @@ namespace NLGUI if (_Position+1 > _Style.size()) return false; - return _Style[_Position] == (ucchar)'/' && _Style[_Position+1] == (ucchar)'*'; + return _Style[_Position] == (char)'/' && _Style[_Position+1] == (char)'*'; } - inline bool is_nonascii(ucchar ch) const + inline bool is_nonascii(char ch) const { return ch >= 0x80 /*&& ch <= 255*/; } - inline bool is_alpha(ucchar ch) const + inline bool is_alpha(char ch) const { return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'); } - inline bool is_digit(ucchar ch) const + inline bool is_digit(char ch) const { return ch >= '0' && ch <= '9'; } - inline bool is_nmchar(ucchar ch) const + inline bool is_nmchar(char ch) const { // checking escape here does not check if next char is '\n' or not return ch == '_' || ch == '-' || is_alpha(ch) || is_digit(ch) || is_nonascii(ch) || ch == '\\'/*is_escape(ch)*/; diff --git a/nel/include/nel/gui/ctrl_base.h b/nel/include/nel/gui/ctrl_base.h index a8bdef85f..39b795252 100644 --- a/nel/include/nel/gui/ctrl_base.h +++ b/nel/include/nel/gui/ctrl_base.h @@ -85,9 +85,10 @@ namespace NLGUI /// Get the ContextHelp for this control. Default is to return _ContextHelp - virtual void getContextHelp(ucstring &help) const {help= _ContextHelp;} + virtual void getContextHelp(std::string &help) const {help= _ContextHelp;} + virtual void getContextHelpAsUtf16(ucstring &help) const {help.fromUtf8(_ContextHelp);} /// Get the ContextHelp for this control, with tooltip specific code. Default behaviour is identical to getContextHelp. - virtual void getContextHelpToolTip(ucstring &help) const { getContextHelp(help); } + virtual void getContextHelpToolTip(std::string &help) const { getContextHelp(help); } // Get the name of the context help window. Default to "context_help" virtual std::string getContextHelpWindowName() const; /// Get the ContextHelp ActionHandler. If "", noop @@ -123,8 +124,10 @@ namespace NLGUI void setToolTipPosRef(THotSpot pos) { _ToolTipPosRef = pos;} /// replace the default contextHelp - ucstring getDefaultContextHelp() const {return _ContextHelp;} - void setDefaultContextHelp(const ucstring &help) {_ContextHelp= help;} + std::string getDefaultContextHelp() const {return _ContextHelp;} + void setDefaultContextHelp(const std::string &help) {_ContextHelp= help;} + ucstring getDefaultContextHelpAsUtf16() const {return ucstring::makeFromUtf8(_ContextHelp);} + void setDefaultContextHelpAsUtf16(const ucstring &help) {_ContextHelp= help.toUtf8();} void setOnContextHelp(const std::string &help) {_OnContextHelp= help;} void setOnContextHelpAHParams(const std::string &p) {_OnContextHelpParams= p;} @@ -158,7 +161,7 @@ namespace NLGUI int luaSetTooltipUtf8(CLuaState &ls); REFLECT_EXPORT_START(CCtrlBase, CViewBase) - REFLECT_UCSTRING("tooltip", getDefaultContextHelp, setDefaultContextHelp); + REFLECT_UCSTRING("tooltip", getDefaultContextHelpAsUtf16, setDefaultContextHelpAsUtf16); // FIXME: Lua UTF-8 REFLECT_LUA_METHOD("setTooltipUtf8", luaSetTooltipUtf8); REFLECT_EXPORT_END @@ -171,7 +174,7 @@ namespace NLGUI protected: // This is the ContextHelp filled by default in parse() - ucstring _ContextHelp; + std::string _ContextHelp; CStringShared _OnContextHelp; CStringShared _OnContextHelpParams; CStringShared _ToolTipSpecialParent; diff --git a/nel/include/nel/gui/ctrl_text_button.h b/nel/include/nel/gui/ctrl_text_button.h index 25fc9eeac..74e1c1291 100644 --- a/nel/include/nel/gui/ctrl_text_button.h +++ b/nel/include/nel/gui/ctrl_text_button.h @@ -96,8 +96,10 @@ namespace NLGUI bool getTextModulateGlobalColorOver() const {return _TextModulateGlobalColorOver;} void setTextModulateGlobalColorOver(bool v) {_TextModulateGlobalColorOver= v;} // Set text (noop if text id) - void setText (const ucstring &text); - ucstring getText () const; + void setText (const std::string &text); + std::string getText () const; + void setTextAsUtf16 (const ucstring &text); + ucstring getTextAsUtf16 () const; void setHardText (const std::string &text); std::string getHardText () const; @@ -130,7 +132,7 @@ namespace NLGUI int luaGetViewText(CLuaState &ls); REFLECT_EXPORT_START(CCtrlTextButton, CCtrlBaseButton) - REFLECT_UCSTRING("uc_hardtext", getText, setText); + REFLECT_UCSTRING("uc_hardtext", getTextAsUtf16, setTextAsUtf16); REFLECT_STRING("hardtext", getHardText, setHardText); REFLECT_SINT32("text_x", getTextX, setTextX) REFLECT_SINT32("wmargin", getWMargin, setWMargin) diff --git a/nel/include/nel/gui/event_descriptor.h b/nel/include/nel/gui/event_descriptor.h index 95bdad212..dd2ae19c4 100644 --- a/nel/include/nel/gui/event_descriptor.h +++ b/nel/include/nel/gui/event_descriptor.h @@ -82,13 +82,13 @@ public: return _Key; } // return the char that has been pressed. The key event type MUST be 'keychar', else => assert - ucchar getChar() const + u32char getChar() const { nlassert(_KeyEvent == keychar); return _Char; } // return the string that has been sent. The key event type MUST be 'keystring', else => assert - ucstring getString() const + std::string getString() const { nlassert(_KeyEvent == keystring); return _String; @@ -141,9 +141,9 @@ private: union { NLMISC::TKey _Key; - ucchar _Char; + u32char _Char; }; - ucstring _String; + std::string _String; }; // ---------------------------------------------------------------------------- diff --git a/nel/include/nel/gui/group_container.h b/nel/include/nel/gui/group_container.h index 742dfcfb2..361ae70b9 100644 --- a/nel/include/nel/gui/group_container.h +++ b/nel/include/nel/gui/group_container.h @@ -248,6 +248,13 @@ namespace NLGUI // Get the header color draw. NB: depends if grayed, and if active. NLMISC::CRGBA getDrawnHeaderColor () const; + std::string getTitleRaw () const; + void setTitleRaw (const std::string &title); + std::string getTitleOpenedRaw () const; + void setTitleOpenedRaw (const std::string &title); + std::string getTitleClosedRaw () const; + void setTitleClosedRaw (const std::string &title); + ucstring getUCTitleOpened () const; void setUCTitleOpened (const ucstring &title); ucstring getUCTitleClosed () const; @@ -287,9 +294,15 @@ namespace NLGUI REFLECT_STRING("title", getTitle, setTitle); REFLECT_STRING("title_opened", getTitleOpened, setTitleOpened); REFLECT_STRING("title_closed", getTitleClosed, setTitleClosed); - REFLECT_UCSTRING("uc_title_opened", getUCTitleOpened, setUCTitleOpened); - REFLECT_UCSTRING("uc_title_closed", getUCTitleClosed, setUCTitleClosed); - REFLECT_UCSTRING("uc_title", getUCTitle, setUCTitle); + + REFLECT_STRING("title_raw", getTitleRaw, setTitleRaw); + REFLECT_STRING("title_opened_raw", getTitleOpenedRaw, setTitleOpenedRaw); + REFLECT_STRING("title_closed_raw", getTitleClosedRaw, setTitleClosedRaw); + + REFLECT_UCSTRING("uc_title_opened", getUCTitleOpened, setUCTitleOpened); // FIXME: Lua UTF-8 + REFLECT_UCSTRING("uc_title_closed", getUCTitleClosed, setUCTitleClosed); // FIXME: Lua UTF-8 + REFLECT_UCSTRING("uc_title", getUCTitle, setUCTitle); // FIXME: Lua UTF-8 + REFLECT_STRING("title_color", getTitleColorAsString, setTitleColorAsString); REFLECT_SINT32("pop_min_h", getPopupMinH, setPopupMinH); REFLECT_SINT32("pop_max_h", getPopupMaxH, setPopupMaxH); @@ -477,8 +490,8 @@ namespace NLGUI float _CurrentRolloverAlphaContainer; float _CurrentRolloverAlphaContent; sint32 _LayerSetup; - ucstring _TitleTextOpened; - ucstring _TitleTextClosed; + std::string _TitleTextOpened; + std::string _TitleTextClosed; CViewText *_TitleOpened; CViewText *_TitleClosed; sint32 _TitleDeltaMaxW; diff --git a/nel/include/nel/gui/group_editbox.h b/nel/include/nel/gui/group_editbox.h index 36b8d63b4..9b2998be0 100644 --- a/nel/include/nel/gui/group_editbox.h +++ b/nel/include/nel/gui/group_editbox.h @@ -65,15 +65,15 @@ namespace NLGUI /// Accessors std::string getInputString() const; std::string getPrompt() const; - const u32string &getInputStringRef() const { return _InputString; } - const u32string &getPromptRef() const { return _Prompt; } + const ::u32string &getInputStringRef() const { return _InputString; } + const ::u32string &getPromptRef() const { return _Prompt; } /** Set the prompt * NB : line returns are encoded as '\n', not '\r\n' */ void setPrompt(const std::string &s); void setInputString(const std::string &str); - void setInputStringRef(const u32string &str) {_InputString = str; }; + void setInputStringRef(const ::u32string &str) {_InputString = str; }; void setInputStringAsInt(sint32 val); sint32 getInputStringAsInt() const; void setInputStringAsInt64(sint64 val); @@ -82,8 +82,8 @@ namespace NLGUI float getInputStringAsFloat() const; void setInputStringAsUtf16(const ucstring &str); ucstring getInputStringAsUtf16() const; - void setInputStringAsUtf32(const u32string &str); - u32string getInputStringAsUtf32() const { return _InputString; } + void setInputStringAsUtf32(const ::u32string &str); + ::u32string getInputStringAsUtf32() const { return _InputString; } void setColor(NLMISC::CRGBA col); @@ -98,7 +98,7 @@ namespace NLGUI static CGroupEditBox *getMenuFather() { return _MenuFather; } - void setCommand(const ucstring &command, bool execute); + void setCommand(const std::string &command, bool execute); // Stop parent from blinking void stopParentBlink() { if (_Parent) _Parent->disableBlink(); } @@ -122,7 +122,7 @@ namespace NLGUI sint32 getMaxHistoric() const {return _MaxHistoric;} sint32 getCurrentHistoricIndex () const {return _CurrentHistoricIndex;} void setCurrentHistoricIndex (sint32 index) {_CurrentHistoricIndex=index;} - const u32string &getHistoric(uint32 index) const {return _Historic[index];} + const ::u32string &getHistoric(uint32 index) const {return _Historic[index];} uint32 getNumHistoric() const {return (uint32)_Historic.size ();} // Get on change action handler @@ -140,7 +140,7 @@ namespace NLGUI // Paste the selection into buffer void paste(); // Write the string into buffer - void writeString(const ucstring &str, bool replace = true, bool atEnd = true); + void writeString(const ucstring &str, bool replace = true, bool atEnd = true); // UTF-16 because of Clipboard implementation // Expand the expression (true if there was a '/' at the start of the line) bool expand(); @@ -171,7 +171,7 @@ namespace NLGUI virtual void onKeyboardCaptureLost(); // set the input string as "default". will be reseted at first click (used for user information) - void setDefaultInputString(const ucstring &str); + void setDefaultInputString(const std::string &str); // For Interger and PositiveInteger, can specify min and max values void setIntegerMinValue(sint32 minValue) {_IntegerMinValue=minValue;} @@ -229,17 +229,17 @@ namespace NLGUI NLMISC::CRGBA _BackSelectColor; // Text info - u32string _Prompt; - u32string _InputString; + ::u32string _Prompt; + ::u32string _InputString; CViewText *_ViewText; // undo / redo - u32string _StartInputString; // value of the input string when focus was acuired first - u32string _ModifiedInputString; + ::u32string _StartInputString; // value of the input string when focus was acuired first + ::u32string _ModifiedInputString; // Historic info - typedef std::deque THistoric; + typedef std::deque<::u32string> THistoric; THistoric _Historic; uint32 _MaxHistoric; sint32 _CurrentHistoricIndex; @@ -276,7 +276,7 @@ namespace NLGUI bool _CanRedo : 1; bool _CanUndo : 1; - std::vector _NegativeFilter; + std::vector _NegativeFilter; sint _CursorTexID; sint32 _CursorWidth; @@ -299,13 +299,13 @@ namespace NLGUI void handleEventString(const NLGUI::CEventDescriptorKey &event); void setup(); void triggerOnChangeAH(); - void appendStringFromClipboard(const ucstring &str); + void appendStringFromClipboard(const ucstring &str); // UTF-16 because of Clipboard implementation - ucstring getSelection(); + ucstring getSelection(); // UTF-16 because of Clipboard implementation static CGroupEditBox *_MenuFather; - static bool isValidAlphaNumSpace(ucchar c) + static bool isValidAlphaNumSpace(u32char c) { if (c > 255) return false; char ac = (char) c; @@ -315,7 +315,7 @@ namespace NLGUI ac==' '; } - static bool isValidAlphaNum(ucchar c) + static bool isValidAlphaNum(u32char c) { if (c > 255) return false; char ac = (char) c; @@ -324,7 +324,7 @@ namespace NLGUI (ac >= 'A' && ac <= 'Z'); } - static bool isValidAlpha(ucchar c) + static bool isValidAlpha(u32char c) { if (c > 255) return false; char ac = (char) c; @@ -332,13 +332,13 @@ namespace NLGUI (ac >= 'A' && ac <= 'Z'); } - static bool isValidPlayerNameChar(ucchar c) + static bool isValidPlayerNameChar(u32char c) { // valid player name (with possible shard prefix / suffix format return isValidAlpha(c) || c=='.' || c=='(' || c==')'; } - static bool isValidFilenameChar(ucchar c) + static bool isValidFilenameChar(u32char c) { if (c == '\\' || c == '/' || @@ -352,12 +352,12 @@ namespace NLGUI return true; } // - bool isFiltered(ucchar c) + bool isFiltered(u32char c) { - uint length = (uint)_NegativeFilter.size(); - for (uint k = 0; k < length; ++k) + ptrdiff_t length = _NegativeFilter.size(); + for (ptrdiff_t k = 0; k < length; ++k) { - if ((ucchar) _NegativeFilter[k] == c) return true; + if (_NegativeFilter[k] == c) return true; } return false; } diff --git a/nel/include/nel/gui/group_html.h b/nel/include/nel/gui/group_html.h index 1013a8b10..56605c0cc 100644 --- a/nel/include/nel/gui/group_html.h +++ b/nel/include/nel/gui/group_html.h @@ -320,16 +320,16 @@ namespace NLGUI void clearContext(); // Translate a char - bool translateChar(ucchar &output, ucchar input, ucchar lastChar) const; + bool translateChar(u32char &output, u32char input, u32char lastChar) const; // Add a string in the current paragraph - void addString(const ucstring &str); + void addString(const std::string &str); // Add an image in the current paragraph void addImage(const std::string &id, const std::string &img, bool reloadImg=false, const CStyleParams &style = CStyleParams()); // Add a text area in the current paragraph - CInterfaceGroup *addTextArea (const std::string &templateName, const char *name, uint rows, uint cols, bool multiLine, const ucstring &content, uint maxlength); + CInterfaceGroup *addTextArea (const std::string &templateName, const char *name, uint rows, uint cols, bool multiLine, const std::string &content, uint maxlength); // Add a combo box in the current paragraph CDBGroupComboBox *addComboBox(const std::string &templateName, const char *name); @@ -350,9 +350,9 @@ namespace NLGUI void flushString(); // Set the title - void setTitle (const ucstring &title); void setTitle (const std::string &title); std::string getTitle() const; + void setTitleRaw (const std::string &title); // Lookup a url in local file system bool lookupLocalFile (std::string &result, const char *url, bool isUrl); @@ -392,10 +392,10 @@ namespace NLGUI bool _TrustedDomain; // Title prefix - ucstring _TitlePrefix; + std::string _TitlePrefix; // Title string - ucstring _TitleString; + std::string _TitleString; // Need to browse next update coords.. bool _BrowseNextTime; @@ -644,7 +644,7 @@ namespace NLGUI std::string Name; // Variable value - ucstring Value; + std::string Value; // Text area group CInterfaceGroup *TextArea; @@ -747,7 +747,7 @@ namespace NLGUI // Current node is a text area bool _TextArea; std::string _TextAreaTemplate; - ucstring _TextAreaContent; + std::string _TextAreaContent; std::string _TextAreaName; uint _TextAreaRow; uint _TextAreaCols; @@ -755,7 +755,7 @@ namespace NLGUI // current mode is in select option bool _SelectOption; - ucstring _SelectOptionStr; + std::string _SelectOptionStr; // Current node is a object std::string _ObjectType; @@ -826,7 +826,7 @@ namespace NLGUI void spliceFragment(std::list::iterator src); // decode all HTML entities - static ucstring decodeHTMLEntities(const ucstring &str); + static std::string decodeHTMLEntities(const std::string &str); struct CDataImageDownload { diff --git a/nel/include/nel/gui/group_list.h b/nel/include/nel/gui/group_list.h index 58af530b5..6e7587e34 100644 --- a/nel/include/nel/gui/group_list.h +++ b/nel/include/nel/gui/group_list.h @@ -67,13 +67,13 @@ namespace NLGUI * \param line : text to be added * \param color : text color */ - void addTextChild (const ucstring& line,const NLMISC::CRGBA &textColor, bool multiLine = true); + void addTextChild (const std::string& line,const NLMISC::CRGBA &textColor, bool multiLine = true); /** * add a text child element to the group, using the text template * \param line : text to be added */ - void addTextChild (const ucstring& line, bool multiLine = true); + void addTextChild (const std::string& line, bool multiLine = true); /// Same as adding a text child but the text will be taken from the string manager void addTextChildID (uint32 id, bool multiLine = true); diff --git a/nel/include/nel/gui/group_menu.h b/nel/include/nel/gui/group_menu.h index 21a740d84..f304a3d60 100644 --- a/nel/include/nel/gui/group_menu.h +++ b/nel/include/nel/gui/group_menu.h @@ -122,12 +122,12 @@ namespace NLGUI // retrieve the index of a line from its id (-1 if not found) sint getLineFromId(const std::string &id); - CViewTextMenu* addLine (const ucstring &name, const std::string &ah, + CViewTextMenu* addLine (const std::string &name, const std::string &ah, const std::string ¶ms, const std::string &id="", const std::string &cond = std::string(), const std::string &texture="", bool checkable = false, bool checked = false, bool formatted = false ); - CViewTextMenu* addLineAtIndex(uint index, const ucstring &name, const std::string &ah, + CViewTextMenu* addLineAtIndex(uint index, const std::string &name, const std::string &ah, const std::string ¶ms, const std::string &id="", const std::string &cond = std::string(), const std::string &texture="", bool checkable = false, bool checked = false, bool formatted = false @@ -332,12 +332,7 @@ namespace NLGUI virtual void setActive (bool state); virtual bool isWindowUnder (sint32 x, sint32 y); - - // add line with a string, for backward compatibility - void addLine (const std::string &name, const std::string &ah, const std::string ¶ms, - const std::string &id = std::string(), - const std::string &cond = std::string(), const std::string &texture="", - bool checkable = false, bool checked = false); + uint getNumLine() const; void deleteLine(uint index); const std::string getActionHandler(uint lineIndex) const; @@ -350,12 +345,12 @@ namespace NLGUI void setRightClickHandler(uint lineIndex, const std::string &ah = ""); void setRightClickHandlerParam(uint lineIndex, const std::string ¶ms = ""); - void addLine (const ucstring &name, const std::string &ah = "", const std::string ¶ms = "", + void addLine (const std::string &name, const std::string &ah = "", const std::string ¶ms = "", const std::string &id = std::string(), const std::string &cond = std::string(), const std::string &texture="", bool checkable = false, bool checked = false ); - void addLineAtIndex (uint index, const ucstring &name, const std::string &ah = "", const std::string ¶ms = "", + void addLineAtIndex (uint index, const std::string &name, const std::string &ah = "", const std::string ¶ms = "", const std::string &id = std::string(), const std::string &cond = std::string(), const std::string &texture="", bool checkable = false, bool checked = false diff --git a/nel/include/nel/gui/group_paragraph.h b/nel/include/nel/gui/group_paragraph.h index 6142bc33b..0e1898633 100644 --- a/nel/include/nel/gui/group_paragraph.h +++ b/nel/include/nel/gui/group_paragraph.h @@ -84,13 +84,13 @@ namespace NLGUI * \param line : text to be added * \param color : text color */ - void addTextChild (const ucstring& line,const NLMISC::CRGBA &textColor, bool multiLine = true); + void addTextChild (const std::string& line,const NLMISC::CRGBA &textColor, bool multiLine = true); /** * add a text child element to the group, using the text template * \param line : text to be added */ - void addTextChild (const ucstring& line, bool multiLine = true); + void addTextChild (const std::string& line, bool multiLine = true); /// Same as adding a text child but the text will be taken from the string manager void addTextChildID (uint32 id, bool multiLine = true); diff --git a/nel/include/nel/gui/group_tree.h b/nel/include/nel/gui/group_tree.h index 266e7e23f..d7518a68d 100644 --- a/nel/include/nel/gui/group_tree.h +++ b/nel/include/nel/gui/group_tree.h @@ -60,7 +60,7 @@ namespace NLGUI bool Show; // If false, the node is not displayed (true default, Root ignored) sint32 YDecal; // Text - ucstring Text; // Internationalized displayed text + std::string Text; // Internationalized displayed text sint32 FontSize; // If -1 (default), then take the groupTree one NLMISC::CRGBA Color; // Template @@ -112,8 +112,10 @@ namespace NLGUI std::string getBitmap() const { return Bitmap; } void setOpened(bool opened) { Opened = opened; } bool getOpened() const { return Opened; } - void setText(const ucstring &text) { Text = text; } - const ucstring& getText() const { return Text; } + void setText(const std::string &text) { Text = text; } + const std::string& getText() const { return Text; } + void setTextAsUtf16(const ucstring &text) { Text = text.toUtf8(); } + ucstring getTextAsUtf16() const { return ucstring::makeFromUtf8(Text); } sint32 getFontSize() const { return FontSize; } void setFontSize(sint32 value) { FontSize = value; } sint32 getYDecal() const { return YDecal; } @@ -181,7 +183,7 @@ namespace NLGUI REFLECT_STRING("AHParamsClose", getAHParamsClose, setAHParamsClose); REFLECT_BOOL("Opened", getOpened, setOpened); REFLECT_BOOL("Show", getShow, setShow); - REFLECT_UCSTRING_REF("Text", getText, setText); + REFLECT_UCSTRING("Text", getTextAsUtf16, setTextAsUtf16); // FIXME: Lua UTF-8 // lua REFLECT_LUA_METHOD("getNumChildren", luaGetNumChildren); REFLECT_LUA_METHOD("getChild", luaGetChild); diff --git a/nel/include/nel/gui/interface_expr.h b/nel/include/nel/gui/interface_expr.h index b967ef7ab..0a9d9b4e9 100644 --- a/nel/include/nel/gui/interface_expr.h +++ b/nel/include/nel/gui/interface_expr.h @@ -59,16 +59,14 @@ namespace NLGUI bool getBool() const; sint64 getInteger() const; double getDouble() const; - std::string getString() const; + const std::string &getString() const; NLMISC::CRGBA getRGBA() const; - const ucstring &getUCString() const; CInterfaceExprUserType *getUserType() const; // set void setBool(bool value) { clean(); _Type = Boolean; _BoolValue = value; } void setInteger(sint64 value) { clean(); _Type = Integer; _IntegerValue = value; } void setDouble(double value) { clean(); _Type = Double; _DoubleValue = value; } void setString(const std::string &value) { clean(); _Type = String; _StringValue = value; } - void setUCString(const ucstring &value) { clean(); _Type = String; _StringValue = value; } void setRGBA(NLMISC::CRGBA value) { clean(); _Type = RGBA; _RGBAValue = (uint32)(value.R+(value.G<<8)+(value.B<<16)+(value.A<<24)); } void setUserType(CInterfaceExprUserType *value); // reset this object to initial state (no type) @@ -99,7 +97,7 @@ namespace NLGUI CInterfaceExprUserType *_UserTypeValue; uint32 _RGBAValue; }; - ucstring _StringValue; // well, can't fit in union, unless we do some horrible hack.. + std::string _StringValue; // well, can't fit in union, unless we do some horrible hack.. private: const char *evalBoolean(const char *expr); const char *evalNumber(const char *expr); diff --git a/nel/include/nel/gui/string_case.h b/nel/include/nel/gui/string_case.h index 300d72c76..bd56c7998 100644 --- a/nel/include/nel/gui/string_case.h +++ b/nel/include/nel/gui/string_case.h @@ -25,7 +25,6 @@ namespace NLGUI { - enum TCaseMode { CaseNormal = 0, // Nothing done @@ -37,11 +36,7 @@ namespace NLGUI CaseCount }; - - void setCase( ucstring &str, TCaseMode mode ); void setCase( std::string &str, TCaseMode mode ); - - } #endif diff --git a/nel/include/nel/gui/view_pointer.h b/nel/include/nel/gui/view_pointer.h index cb550e44a..bc605a717 100644 --- a/nel/include/nel/gui/view_pointer.h +++ b/nel/include/nel/gui/view_pointer.h @@ -55,7 +55,7 @@ namespace NLGUI bool getStringMode() const {return _StringMode;} // Set cursor string - void setString (const ucstring &str); + void setString (const std::string &str); // TEMP PATCH void setCursor (const std::string &name) @@ -126,14 +126,14 @@ namespace NLGUI bool _ForceStringMode; CInterfaceGroup *_StringCursor; CInterfaceGroup *_StringCursorHardware; - ucstring _ContextString; + std::string _ContextString; // draw current cursor with the given texture, or, if in hardware mode, change the hardware cursor shape void drawCursor(sint32 texId, NLMISC::CRGBA col, uint8 rot); private: // set the string into frame for software or hardware version - void setString (const ucstring &str, CInterfaceGroup *target); + void setString(const std::string &str, CInterfaceGroup *target); static bool hwMouse; diff --git a/nel/include/nel/gui/view_text.h b/nel/include/nel/gui/view_text.h index 2ffaa8d49..7c0324f58 100644 --- a/nel/include/nel/gui/view_text.h +++ b/nel/include/nel/gui/view_text.h @@ -222,7 +222,7 @@ namespace NLGUI int luaSetLineMaxW(CLuaState &ls); REFLECT_EXPORT_START(CViewText, CViewBase) - REFLECT_STRING("text", getText, setText); + REFLECT_STRING("text_raw", getText, setText); REFLECT_STRING("hardtext", getHardText, setHardText); // REFLECT_UCSTRING("uc_text", getTextAsUtf16, setTextAsUtf16); // Deprecate uc_ functions REFLECT_UCSTRING("uc_hardtext", getHardTextAsUtf16, setHardTextAsUtf16); @@ -262,8 +262,8 @@ namespace NLGUI // width of the font in pixel. Just a Hint for tabing format (computed with '_') float _FontWidth; // strings to use when computing font size - ucstring _FontSizingChars; - ucstring _FontSizingFallback; + ::u32string _FontSizingChars; + ::u32string _FontSizingFallback; // height of the font in pixel. // use getFontHeight float _FontHeight; @@ -465,7 +465,7 @@ namespace NLGUI void addDontClipWordLine(std::vector &currLine); // FormatTag build. - static void buildFormatTagText(const std::string &text, std::string &textBuild, std::vector &formatTags, std::vector &tooltips); + static void buildFormatTagText(const std::string &text, std::string &textBuild, std::vector &formatTags, std::vector &tooltips); // FormatTag parsing. bool isFormatTagChange(uint textIndex, uint ctIndex) const; void getFormatTagChange(uint textIndex, uint &ctIndex, CFormatInfo &wordFormat) const; diff --git a/nel/include/nel/gui/view_text_formated.h b/nel/include/nel/gui/view_text_formated.h index 43a7eb9a8..f6a3cf443 100644 --- a/nel/include/nel/gui/view_text_formated.h +++ b/nel/include/nel/gui/view_text_formated.h @@ -45,7 +45,7 @@ namespace NLGUI { public: virtual ~IViewTextFormatter(){} - virtual ucstring formatString( const ucstring &inputString, const ucstring ¶mString ) = 0; + virtual std::string formatString( const std::string &inputString, const std::string ¶mString ) = 0; }; CViewTextFormated (const TCtorParam ¶m) : CViewText(param) @@ -55,15 +55,15 @@ namespace NLGUI xmlNodePtr serialize( xmlNodePtr parentNode, const char *type ) const; virtual bool parse(xmlNodePtr cur, CInterfaceGroup * parentGroup); virtual void checkCoords(); - const ucstring &getFormatString() const { return _FormatString; } - void setFormatString(const ucstring &format); + const std::string &getFormatString() const { return _FormatString; } + void setFormatString(const std::string &format); - static ucstring formatString(const ucstring &inputString, const ucstring ¶mString); + static std::string formatString(const std::string &inputString, const std::string ¶mString); static void setFormatter( IViewTextFormatter *formatter ){ textFormatter = formatter; } private: - ucstring _FormatString; + std::string _FormatString; static IViewTextFormatter *textFormatter; }; diff --git a/nel/include/nel/gui/view_text_id.h b/nel/include/nel/gui/view_text_id.h index 1e46de062..8c012f319 100644 --- a/nel/include/nel/gui/view_text_id.h +++ b/nel/include/nel/gui/view_text_id.h @@ -58,8 +58,10 @@ namespace NLGUI { public: virtual ~IViewTextProvider(){} - virtual bool getString( uint32 stringId, ucstring &result ) = 0; - virtual bool getDynString( uint32 dynStringId, ucstring &result ) = 0; + bool getString(uint32 stringId, std::string &result) { ucstring temp; bool res = getString(stringId, temp); result = temp.toUtf8(); return res; } + bool getDynString(uint32 dynStringId, std::string &result) { ucstring temp; bool res = getDynString(dynStringId, temp); result = temp.toUtf8(); return res; } + virtual bool getString( uint32 stringId, ucstring &result ) = 0; // TODO: UTF-8 + virtual bool getDynString( uint32 dynStringId, ucstring &result ) = 0; // TODO: UTF-8 }; CViewTextID(const TCtorParam ¶m) : CViewText(param) diff --git a/nel/include/nel/gui/view_text_id_formated.h b/nel/include/nel/gui/view_text_id_formated.h index cbc494dc1..dfd11d0d4 100644 --- a/nel/include/nel/gui/view_text_id_formated.h +++ b/nel/include/nel/gui/view_text_id_formated.h @@ -49,10 +49,10 @@ namespace NLGUI xmlNodePtr serialize( xmlNodePtr parentNode, const char *type ) const; virtual bool parse(xmlNodePtr cur, CInterfaceGroup * parentGroup); virtual void checkCoords(); - const ucstring &getFormatString() const { return _FormatString; } - void setFormatString(const ucstring &format); + const std::string &getFormatString() const { return _FormatString; } + void setFormatString(const std::string &format); private: - ucstring _FormatString; + std::string _FormatString; }; } diff --git a/nel/include/nel/gui/widget_manager.h b/nel/include/nel/gui/widget_manager.h index d0c65356b..cd71cd869 100644 --- a/nel/include/nel/gui/widget_manager.h +++ b/nel/include/nel/gui/widget_manager.h @@ -333,8 +333,8 @@ namespace NLGUI void updateTooltipCoords(CCtrlBase *newCtrl); /// for ContextHelp action handler only: set the result name - void setContextHelpText( const ucstring &text ){ _ContextHelpText = text; } - ucstring& getContextHelpText(){ return _ContextHelpText; } + void setContextHelpText( const std::string &text ){ _ContextHelpText = text; } + std::string& getContextHelpText(){ return _ContextHelpText; } /// force disable the context help void disableContextHelp(); @@ -626,7 +626,7 @@ namespace NLGUI SInterfaceTimes interfaceTimes; - ucstring _ContextHelpText; + std::string _ContextHelpText; bool _ContextHelpActive; bool inGame; diff --git a/nel/include/nel/misc/common.h b/nel/include/nel/misc/common.h index 2f678acef..7b89bae3b 100644 --- a/nel/include/nel/misc/common.h +++ b/nel/include/nel/misc/common.h @@ -227,8 +227,8 @@ inline double isValidDouble (double v) * \param str a string to transform to lower case */ -std::string toLower ( const char *str ); // Ascii only -std::string toLower ( const std::string &str ); // Ascii only +std::string toLower ( const char *str ); // UTF-8 +std::string toLower ( const std::string &str ); // UTF-8 void toLower ( char *str ); // Ascii only char toLower ( const char ch ); // convert only one character @@ -236,8 +236,8 @@ char toLower ( const char ch ); // convert only one character * \param a string to transform to upper case */ -// std::string toUpper ( const char *str ); // Ascii only -std::string toUpper ( const std::string &str); // Ascii only +std::string toUpper ( const char *str ); // UTF-8 +std::string toUpper ( const std::string &str); // UTF-8 void toUpper ( char *str); // Ascii only diff --git a/nel/include/nel/misc/events.h b/nel/include/nel/misc/events.h index c783a85eb..6cfe902b8 100644 --- a/nel/include/nel/misc/events.h +++ b/nel/include/nel/misc/events.h @@ -320,11 +320,11 @@ public: class CEventChar : public CEventKey { public: - CEventChar (ucchar c, TKeyButton button, IEventEmitter* emitter) : CEventKey (button, emitter, EventCharId), _Raw(true) + CEventChar (u32char c, TKeyButton button, IEventEmitter* emitter) : CEventKey (button, emitter, EventCharId), _Raw(true) { Char=c; } - ucchar Char; + u32char Char; virtual CEvent *clone() const {return new CEventChar(*this);} void setRaw( bool raw ) { _Raw = raw; } @@ -341,11 +341,11 @@ private: class CEventString : public CEventKey { public: - CEventString (const ucstring &str, IEventEmitter* emitter) : CEventKey (noKeyButton, emitter, EventStringId) + CEventString (const std::string &str, IEventEmitter* emitter) : CEventKey (noKeyButton, emitter, EventStringId) { String = str; } - ucstring String; + std::string String; virtual CEvent *clone() const {return new CEventString(*this);} }; diff --git a/nel/include/nel/misc/i18n.h b/nel/include/nel/misc/i18n.h index e8b00385b..28df54c5e 100644 --- a/nel/include/nel/misc/i18n.h +++ b/nel/include/nel/misc/i18n.h @@ -99,7 +99,7 @@ public: /// Return a vector with all language available. The vector contains the name of the language. /// The index in the vector is used in \c load() function - static const std::vector &getLanguageNames(); + static const std::vector &getLanguageNames(); /** Return a vector with all language code available. * Code are ISO 639-2 compliant. @@ -122,7 +122,7 @@ public: static void loadFromFilename (const std::string &filename, bool reload); /// Returns the name of the language in the language name (English, Francais, ...) - static ucstring getCurrentLanguageName (); + static std::string getCurrentLanguageName (); /// Returns the code of the language ("fr", "en", ...) static std::string getCurrentLanguageCode (); @@ -134,7 +134,10 @@ public: static bool setSystemLanguageCode (const std::string &languageCode); /// Find a string in the selected language and return his association. - static const ucstring &get (const std::string &label); + static const ucstring &getAsUtf16 (const std::string &label); + + /// Find a string in the selected language and return his association. + static const std::string &get (const std::string &label); // Test if a string has a translation in the selected language. // NB : The empty string is considered to have a translation @@ -219,24 +222,28 @@ public: private: - typedef std::map StrMapContainer; + typedef std::map StrMapContainer; + typedef std::map StrMapContainer16; static ILoadProxy *_LoadProxy; static StrMapContainer _StrMap; + static StrMapContainer16 _StrMap16; static bool _StrMapLoaded; // the alternative language that will be used if the sentence is not found in the original language static StrMapContainer _StrMapFallback; + static StrMapContainer16 _StrMapFallback16; static std::vector _LanguageCodes; - static std::vector _LanguageNames; + static std::vector _LanguageNames; static std::string _SystemLanguageCode; static bool _LanguagesNamesLoaded; static std::string _SelectedLanguageCode; - static const ucstring _NotTranslatedValue; + static const ucstring _NotTranslatedValue16; + static const std::string _NotTranslatedValue; /** Structure to hold contextual info during * read of preprocessed file @@ -256,7 +263,7 @@ private: /// Init _LanguageCodes and _LanguageNames static void initLanguages(); - static bool loadFileIntoMap(const std::string &filename, StrMapContainer &dest); + static bool loadFileIntoMap(const std::string &filename, StrMapContainer &dest, StrMapContainer16 &dest16); /// The internal read function, it does the real job of readTextFile static void _readTextFile(const std::string &filename, diff --git a/nel/include/nel/misc/ucstring.h b/nel/include/nel/misc/ucstring.h index 8bbcd828d..61f7f416b 100644 --- a/nel/include/nel/misc/ucstring.h +++ b/nel/include/nel/misc/ucstring.h @@ -260,12 +260,6 @@ ucstring toUpper(const ucstring &str); void toUpper(ucchar *str); ucchar toUpper(ucchar c); -std::string toLowerAsUtf8(const char *str); -std::string toLowerAsUtf8(const std::string &str); - -std::string toUpperAsUtf8(const char *str); -std::string toUpperAsUtf8(const std::string &str); - }; #endif // NL_UCSTRING_H diff --git a/nel/include/nel/misc/utf_string_view.h b/nel/include/nel/misc/utf_string_view.h index 61291f421..ab8a25a58 100644 --- a/nel/include/nel/misc/utf_string_view.h +++ b/nel/include/nel/misc/utf_string_view.h @@ -54,11 +54,11 @@ public: inline CUtfStringView(const ucstring &utf16Str) : m_Str(utf16Str.c_str()), m_Size(utf16Str.size() << 1), m_Iterator(utf16Iterator) {} inline CUtfStringView(const ucchar *utf16Str) : m_Str(utf16Str), m_Size(strlen((const char *)utf16Str) & (ptrdiff_t)(-2)), m_Iterator(utf16Iterator) {} - inline CUtfStringView(const u32string &utf32Str) : m_Str(utf32Str.c_str()), m_Size(utf32Str.size() << 2), m_Iterator(utf32Iterator) {} + inline CUtfStringView(const ::u32string &utf32Str) : m_Str(utf32Str.c_str()), m_Size(utf32Str.size() << 2), m_Iterator(utf32Iterator) {} std::string toUtf8(bool reEncode = false) const; // Makes a copy ucstring toUtf16(bool reEncode = false) const; // Makes a copy - u32string toUtf32() const; // Makes a copy + ::u32string toUtf32() const; // Makes a copy std::wstring toWide() const; // Platform dependent, UTF-16 or UTF-32. Makes a copy. std::string toAscii() const; // Returns only values 0-127, 7-bit ASCII. Makes a copy. diff --git a/nel/samples/misc/i18n/main.cpp b/nel/samples/misc/i18n/main.cpp index 1c8ddabb9..5456c1325 100644 --- a/nel/samples/misc/i18n/main.cpp +++ b/nel/samples/misc/i18n/main.cpp @@ -44,9 +44,9 @@ int main (int argc, char **argv) // load the language CI18N::load(langName); - InfoLog->displayRawNL(CI18N::get("Hi").toString().c_str()); - InfoLog->displayRawNL(CI18N::get("PresentI18N").toString().c_str(), "Nevrax"); - InfoLog->displayRawNL(CI18N::get("ExitStr").toString().c_str()); + InfoLog->displayRawNL(CI18N::get("Hi").c_str()); + InfoLog->displayRawNL(CI18N::get("PresentI18N").c_str(), "Nevrax"); + InfoLog->displayRawNL(CI18N::get("ExitStr").c_str()); getchar(); return EXIT_SUCCESS; diff --git a/nel/src/3d/driver/direct3d/driver_direct3d.cpp b/nel/src/3d/driver/direct3d/driver_direct3d.cpp index 211ed27fd..bb954ba4d 100644 --- a/nel/src/3d/driver/direct3d/driver_direct3d.cpp +++ b/nel/src/3d/driver/direct3d/driver_direct3d.cpp @@ -1265,6 +1265,10 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l return 0; } + // https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-unichar + if (message == WM_UNICHAR) + return (wParam == UNICODE_NOCHAR); + return DefWindowProcW(hWnd, message, wParam, lParam); } diff --git a/nel/src/3d/driver/opengl/driver_opengl_window.cpp b/nel/src/3d/driver/opengl/driver_opengl_window.cpp index f04ad304e..dc48ecbf0 100644 --- a/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -183,6 +183,10 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l return 0; } + // https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-unichar + if (message == WM_UNICHAR) + return (wParam == UNICODE_NOCHAR); + return trapMessage ? 0 : DefWindowProcW(hWnd, message, wParam, lParam); } diff --git a/nel/src/3d/driver/opengl/unix_event_emitter.cpp b/nel/src/3d/driver/opengl/unix_event_emitter.cpp index d4153dde5..2945b90e7 100644 --- a/nel/src/3d/driver/opengl/unix_event_emitter.cpp +++ b/nel/src/3d/driver/opengl/unix_event_emitter.cpp @@ -29,6 +29,7 @@ #include #include #include "nel/misc/debug.h" +#include "nel/misc/utf_string_view.h" #ifdef DEBUG_NEW #define new DEBUG_NEW @@ -537,8 +538,7 @@ bool CUnixEventEmitter::processMessage (XEvent &event, CEventServer *server) if (c > 0) { #ifdef X_HAVE_UTF8_STRING - ucstring ucstr; - ucstr.fromUtf8(Text); + ::u32string ucstr = NLMISC::CUtfStringView(Text).toUtf32(); CEventChar *charEvent = new CEventChar (ucstr[0], getKeyButton(event.xbutton.state), this); @@ -549,7 +549,7 @@ bool CUnixEventEmitter::processMessage (XEvent &event, CEventServer *server) #else for (int i = 0; i < c; i++) { - CEventChar *charEvent = new CEventChar ((ucchar)(unsigned char)Text[i], getKeyButton(event.xbutton.state), this); + CEventChar *charEvent = new CEventChar ((u32char)(unsigned char)Text[i], getKeyButton(event.xbutton.state), this); // raw if not processed by IME charEvent->setRaw(keyCode != 0); diff --git a/nel/src/3d/text_context.cpp b/nel/src/3d/text_context.cpp index ba40904b3..b31a82959 100644 --- a/nel/src/3d/text_context.cpp +++ b/nel/src/3d/text_context.cpp @@ -77,7 +77,7 @@ uint32 CTextContext::textPush (const char *format, ...) char *str; NLMISC_CONVERT_VARGS (str, format, NLMISC::MaxCStringSize); - return textPush(str); + return textPush(NLMISC::CUtfStringView(str)); } // ------------------------------------------------------------------------------------------------ diff --git a/nel/src/gui/css_parser.cpp b/nel/src/gui/css_parser.cpp index e59cf832b..ebc8d8d34 100644 --- a/nel/src/gui/css_parser.cpp +++ b/nel/src/gui/css_parser.cpp @@ -65,7 +65,7 @@ namespace NLGUI _Rules.clear(); _Style.clear(); - _Style.fromUtf8(cssString); + _Style = cssString; preprocess(); _Position = 0; @@ -73,7 +73,7 @@ namespace NLGUI { skipWhitespace(); - if (_Style[_Position] == (ucchar)'@') + if (_Style[_Position] == '@') readAtRule(); else readRule(); @@ -89,13 +89,13 @@ namespace NLGUI // style: "color: red; font-size: 10px;" // // @internal - void CCssParser::parseRule(const ucstring &selectorString, const ucstring &styleString) + void CCssParser::parseRule(const std::string &selectorString, const std::string &styleString) { - std::vector selectors; - NLMISC::explode(selectorString, ucstring(","), selectors); + std::vector selectors; + NLMISC::explode(selectorString, std::string(","), selectors); TStyleVec props; - props = parseDecls(styleString.toUtf8()); + props = parseDecls(styleString); // duplicate props to each selector in selector list, // example 'div > p, h1' creates 'div>p' and 'h1' @@ -129,7 +129,7 @@ namespace NLGUI skipIdentifier(); // skip at-rule statement - while(!is_eof() && _Style[_Position] != (ucchar)';') + while(!is_eof() && _Style[_Position] != ';') { if (maybe_escape()) { @@ -174,9 +174,9 @@ namespace NLGUI _Position++; else if (is_quote(_Style[_Position])) skipString(); - else if (_Style[_Position] == (ucchar)'[') + else if (_Style[_Position] == '[') skipBlock(); - else if (_Style[_Position] == (ucchar)'{') + else if (_Style[_Position] == '{') break; else _Position++; @@ -184,7 +184,7 @@ namespace NLGUI if (!is_eof()) { - ucstring selector; + std::string selector; selector.append(_Style, start, _Position - start); skipWhitespace(); @@ -194,7 +194,7 @@ namespace NLGUI skipBlock(); if (_Position <= _Style.size()) { - ucstring rules; + std::string rules; rules.append(_Style, start + 1, _Position - start - 2); parseRule(selector, rules); @@ -215,7 +215,7 @@ namespace NLGUI for(uint i=0; i<6 && is_hex(_Style[_Position]); i++) _Position++; - if (_Style[_Position] == (ucchar)' ') + if (_Style[_Position] == ' ') _Position++; } else if (_Style[_Position] != 0x0A) @@ -246,23 +246,23 @@ namespace NLGUI // cannot start with digit valid = false; } - else if ((_Position - start) == 0 && _Style[_Position-1] == (ucchar)'-') + else if ((_Position - start) == 0 && _Style[_Position-1] == '-') { // cannot start with -# valid = false; } } - else if (_Style[_Position] == (ucchar)'_') + else if (_Style[_Position] == '_') { // valid } - else if (_Style[_Position] >= 0x0080) + else if (_Style[_Position] >= 0x80) { // valid } - else if (_Style[_Position] == (ucchar)'-') + else if (_Style[_Position] == '-') { - if ((_Position - start) == 1 && _Style[_Position-1] == (ucchar)'-') + if ((_Position - start) == 1 && _Style[_Position-1] == '-') { // cannot start with -- valid = false; @@ -285,7 +285,7 @@ namespace NLGUI // @internal void CCssParser::skipBlock() { - ucchar startChar = _Style[_Position]; + char startChar = _Style[_Position]; // block start _Position++; @@ -311,7 +311,7 @@ namespace NLGUI // @internal void CCssParser::skipString() { - ucchar endChar = _Style[_Position]; + char endChar = _Style[_Position]; // quote start _Position++; @@ -338,7 +338,7 @@ namespace NLGUI // *************************************************************************** // parse selector list // @internal - std::vector CCssParser::parse_selector(const ucstring &sel, std::string &pseudoElement) const + std::vector CCssParser::parse_selector(const std::string &sel, std::string &pseudoElement) const { std::vector result; CCssSelector current; @@ -346,10 +346,10 @@ namespace NLGUI pseudoElement.clear(); bool failed = false; - ucstring::size_type start = 0, pos = 0; + std::string::size_type start = 0, pos = 0; while(pos < sel.size()) { - ucstring uc; + std::string uc; uc = sel[pos]; if (is_nmchar(sel[pos]) && current.empty()) { @@ -358,7 +358,7 @@ namespace NLGUI while(pos < sel.size() && is_nmchar(sel[pos])) pos++; - current.Element = toLower(sel.substr(start, pos - start).toUtf8()); + current.Element = toLower(sel.substr(start, pos - start)); start = pos; continue; } @@ -371,7 +371,7 @@ namespace NLGUI while(pos < sel.size() && is_nmchar(sel[pos])) pos++; - current.Id = toLower(sel.substr(start, pos - start).toUtf8()); + current.Id = toLower(sel.substr(start, pos - start)); start = pos; } else if (sel[pos] == '.') @@ -383,7 +383,7 @@ namespace NLGUI while(pos < sel.size() && (is_nmchar(sel[pos]) || sel[pos] == '.')) pos++; - current.setClass(toLower(sel.substr(start, pos - start).toUtf8())); + current.setClass(toLower(sel.substr(start, pos - start))); start = pos; } else if (sel[pos] == '[') @@ -399,9 +399,9 @@ namespace NLGUI start = pos; } - ucstring key; - ucstring value; - ucchar op = ' '; + std::string key; + std::string value; + char op = ' '; // key while(pos < sel.size() && is_nmchar(sel[pos])) @@ -420,7 +420,7 @@ namespace NLGUI if (sel[pos] == ']') { - current.addAttribute(key.toUtf8()); + current.addAttribute(key); } else { @@ -496,14 +496,14 @@ namespace NLGUI // [value="attr" i] if (value.size() > 2 && value[value.size()-2] == ' ') { - ucchar lastChar = value[value.size()-1]; + char lastChar = value[value.size()-1]; if (lastChar == 'i' || lastChar == 'I' || lastChar == 's' || lastChar == 'S') { value = value.substr(0, value.size()-2); cs = !((lastChar == 'i' || lastChar == 'I')); } } - current.addAttribute(key.toUtf8(), trimQuotes(value).toUtf8(), (char)op, cs); + current.addAttribute(key, trimQuotes(value), (char)op, cs); } // op error } // no value @@ -549,7 +549,7 @@ namespace NLGUI } } - std::string key = toLower(sel.substr(start, pos - start).toUtf8()); + std::string key = toLower(sel.substr(start, pos - start)); if (key.empty()) { failed = true; @@ -647,7 +647,7 @@ namespace NLGUI size_t start; size_t charsLeft; bool quote = false; - ucchar quoteChar; + char quoteChar; while(!is_eof()) { charsLeft = _Style.size() - _Position - 1; @@ -660,8 +660,8 @@ namespace NLGUI if (charsLeft >= 1 && _Style[_Position] == 0x0D && _Style[_Position+1] == 0x0A) len++; - ucstring tmp; - tmp += 0x000A; + std::string tmp; + tmp += 0x0A; _Style.replace(_Position, 1, tmp); } else if (_Style[_Position] == 0x00) @@ -686,12 +686,12 @@ namespace NLGUI } else if (!quote && is_comment_open()) { - size_t pos = _Style.find(ucstring("*/"), _Position + 2); + size_t pos = _Style.find("*/", _Position + 2); if (pos == std::string::npos) pos = _Style.size(); _Style.erase(_Position, pos - _Position + 2); - ucstring uc; + std::string uc; uc = _Style[_Position]; // _Position is already at correct place diff --git a/nel/src/gui/ctrl_base.cpp b/nel/src/gui/ctrl_base.cpp index 0124bfdee..1f652031b 100644 --- a/nel/src/gui/ctrl_base.cpp +++ b/nel/src/gui/ctrl_base.cpp @@ -129,7 +129,7 @@ namespace NLGUI if (!editorMode) _ContextHelp = CI18N::get((const char *)prop); else - _ContextHelp.fromUtf8((const char *)prop); + _ContextHelp = (const char *)prop; } else { @@ -140,7 +140,7 @@ namespace NLGUI if (!editorMode && NLMISC::startsWith((const char *)prop, "ui")) _ContextHelp = CI18N::get((const char *)prop); else - _ContextHelp.fromUtf8((const char *)prop); + _ContextHelp = (const char *)prop; } } @@ -197,12 +197,12 @@ namespace NLGUI { if( name == "tooltip" ) { - return _ContextHelp.toUtf8(); + return _ContextHelp; } else if( name == "tooltip_i18n" ) { - return _ContextHelp.toUtf8(); + return _ContextHelp; } else if( name == "on_tooltip" ) @@ -261,7 +261,7 @@ namespace NLGUI if (!editorMode && NLMISC::startsWith(value, "ui")) _ContextHelp = CI18N::get(value); else - _ContextHelp.fromUtf8(value); + _ContextHelp = value; return; } else @@ -270,7 +270,7 @@ namespace NLGUI if (!editorMode) _ContextHelp = CI18N::get(value); else - _ContextHelp.fromUtf8(value); + _ContextHelp = value; return; } else @@ -382,8 +382,8 @@ namespace NLGUI if( node == NULL ) return NULL; - xmlNewProp( node, BAD_CAST "tooltip", BAD_CAST _ContextHelp.toString().c_str() ); - xmlNewProp( node, BAD_CAST "tooltip_i18n", BAD_CAST _ContextHelp.toString().c_str() ); + xmlNewProp( node, BAD_CAST "tooltip", BAD_CAST _ContextHelp.c_str() ); + xmlNewProp( node, BAD_CAST "tooltip_i18n", BAD_CAST _ContextHelp.c_str() ); xmlNewProp( node, BAD_CAST "on_tooltip", BAD_CAST _OnContextHelp.toString().c_str() ); xmlNewProp( node, BAD_CAST "on_tooltip_params", BAD_CAST _OnContextHelpParams.toString().c_str() ); xmlNewProp( node, BAD_CAST "tooltip_parent", BAD_CAST tooltipParentToString( _ToolTipParent ).c_str() ); @@ -476,7 +476,7 @@ namespace NLGUI // *************************************************************************** bool CCtrlBase::emptyContextHelp() const { - ucstring help; + std::string help; getContextHelp(help); std::string sTmp = _OnContextHelp; return help.empty() && sTmp.empty(); @@ -494,12 +494,15 @@ namespace NLGUI void CCtrlBase::serial(NLMISC::IStream &f) { CViewBase::serial(f); + + uint version = f.serialVersion(1); + nlassert(version); + f.serial(_ContextHelp); f.serial(_OnContextHelp); f.serial(_OnContextHelpParams); f.serial(_ToolTipSpecialParent); f.serialEnum(_ToolTipParent); - // THotSpot tmpToolTipParentPosRef = _ToolTipParentPosRef; THotSpot tmpToolTipPosRef = _ToolTipPosRef; @@ -515,7 +518,7 @@ namespace NLGUI _ToolTipPosRef = tmpToolTipPosRef; _ToolTipParentPosRefAlt = tmpToolTipParentPosRefAlt; _ToolTipPosRefAlt = tmpToolTipPosRefAlt; - // + nlSerialBitBool(f, _ToolTipInstant); } @@ -577,7 +580,7 @@ namespace NLGUI CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING); std::string tooltip = ls.toString(1); - setDefaultContextHelp(ucstring::makeFromUtf8(tooltip)); + setDefaultContextHelp(tooltip); return 0; } diff --git a/nel/src/gui/ctrl_text_button.cpp b/nel/src/gui/ctrl_text_button.cpp index 1bd32be27..5cc89c9a7 100644 --- a/nel/src/gui/ctrl_text_button.cpp +++ b/nel/src/gui/ctrl_text_button.cpp @@ -598,7 +598,7 @@ namespace NLGUI const char *propPtr = prop; std::string text; if (NLMISC::startsWith(propPtr, "ui")) - text = CI18N::get(propPtr).toUtf8(); + text = CI18N::get(propPtr); else text = propPtr; _ViewText->setText(text); @@ -1041,14 +1041,29 @@ namespace NLGUI // *************************************************************************** - void CCtrlTextButton::setText (const ucstring &text) + void CCtrlTextButton::setText (const std::string &text) + { + if (_ViewText && !_IsViewTextId) + _ViewText->setText(text); + } + + // *************************************************************************** + std::string CCtrlTextButton::getText () const + { + if (_ViewText && !_IsViewTextId) + return _ViewText->getText(); + return std::string(); + } + + // *************************************************************************** + void CCtrlTextButton::setTextAsUtf16 (const ucstring &text) { if (_ViewText && !_IsViewTextId) _ViewText->setText(text.toUtf8()); } // *************************************************************************** - ucstring CCtrlTextButton::getText () const + ucstring CCtrlTextButton::getTextAsUtf16 () const { if (_ViewText && !_IsViewTextId) return CUtfStringView(_ViewText->getText()).toUtf16(); diff --git a/nel/src/gui/dbgroup_combo_box.cpp b/nel/src/gui/dbgroup_combo_box.cpp index dd7f2154d..b13005b33 100644 --- a/nel/src/gui/dbgroup_combo_box.cpp +++ b/nel/src/gui/dbgroup_combo_box.cpp @@ -45,7 +45,7 @@ namespace NLGUI // Compare strings static inline bool lt_text(const std::pair &s1, const std::pair &s2) { - return toLowerAsUtf8(s1.second) < toLowerAsUtf8(s2.second); + return toLower(s1.second) < toLower(s2.second); } std::string CDBGroupComboBox::measureMenu; @@ -184,7 +184,7 @@ namespace NLGUI { const char *propPtr = name; if (NLMISC::startsWith(propPtr, "ui")) - addText(CI18N::get(propPtr).toUtf8()); + addText(CI18N::get(propPtr)); else addText(propPtr); } @@ -668,7 +668,7 @@ namespace NLGUI { checkable = true; } - groupMenu->addLine(ucstring::makeFromUtf8(getText(i)), "combo_box_select_end", toString(i), + groupMenu->addLine(getText(i), "combo_box_select_end", toString(i), "", std::string(), getTexture(i), checkable); groupMenu->setGrayedLine(i, getGrayed(i)); } diff --git a/nel/src/gui/dbview_quantity.cpp b/nel/src/gui/dbview_quantity.cpp index 0f90d598e..192b0a936 100644 --- a/nel/src/gui/dbview_quantity.cpp +++ b/nel/src/gui/dbview_quantity.cpp @@ -148,7 +148,7 @@ namespace NLGUI { const char *propPtr = ptr; if (NLMISC::startsWith(propPtr, "ui")) - _EmptyText = CI18N::get(propPtr).toUtf8(); + _EmptyText = CI18N::get(propPtr); else _EmptyText = propPtr; } diff --git a/nel/src/gui/group_container.cpp b/nel/src/gui/group_container.cpp index 7bab62820..141c7ba9b 100644 --- a/nel/src/gui/group_container.cpp +++ b/nel/src/gui/group_container.cpp @@ -1338,19 +1338,19 @@ namespace NLGUI if( name == "title" ) { if( _TitleTextOpened == _TitleTextClosed ) - return _TitleTextOpened.toString(); + return _TitleTextOpened; else return ""; } else if( name == "title_opened" ) { - return _TitleTextOpened.toString(); + return _TitleTextOpened; } else if( name == "title_closed" ) { - return _TitleTextClosed.toString(); + return _TitleTextClosed; } else if( name == "header_active" ) @@ -1997,12 +1997,12 @@ namespace NLGUI xmlSetProp( node, BAD_CAST "content_y_offset", BAD_CAST toString( _ContentYOffset ).c_str() ); if( _TitleTextOpened == _TitleTextClosed ) - xmlSetProp( node, BAD_CAST "title", BAD_CAST _TitleTextOpened.toString().c_str() ); + xmlSetProp( node, BAD_CAST "title", BAD_CAST _TitleTextOpened.c_str() ); else xmlSetProp( node, BAD_CAST "title", BAD_CAST "" ); - xmlSetProp( node, BAD_CAST "title_opened", BAD_CAST _TitleTextOpened.toString().c_str() ); - xmlSetProp( node, BAD_CAST "title_closed", BAD_CAST _TitleTextClosed.toString().c_str() ); + xmlSetProp( node, BAD_CAST "title_opened", BAD_CAST _TitleTextOpened.c_str() ); + xmlSetProp( node, BAD_CAST "title_closed", BAD_CAST _TitleTextClosed.c_str() ); xmlSetProp( node, BAD_CAST "header_active", BAD_CAST toString( _HeaderActive ).c_str() ); if( _HeaderColor.getNodePtr() != NULL ) @@ -3712,7 +3712,7 @@ namespace NLGUI { CViewTextID *vti= new CViewTextID(CViewBase::TCtorParam()); // the title here is actually the DB path - vti->setDBTextID(_TitleTextOpened.toString()); + vti->setDBTextID(_TitleTextOpened); vti->setDynamicString(_TitleClass==TitleTextDynString); _TitleOpened = vti; } @@ -3744,7 +3744,7 @@ namespace NLGUI _TitleOpened->setY (pLayer->getValSInt32 ("title_offset_y")); } _TitleOpened->setFontSize (pLayer->getValSInt32 ("title_font_size")); - if (_TitleClass==TitleText) _TitleOpened->setText (_TitleTextOpened.toUtf8()); + if (_TitleClass==TitleText) _TitleOpened->setText (_TitleTextOpened); _TitleOpened->setActive (_Opened); // Title when the container is closed @@ -3764,7 +3764,7 @@ namespace NLGUI { CViewTextID *vti= new CViewTextID(CViewBase::TCtorParam()); // the title here is actually the DB path - vti->setDBTextID(_TitleTextClosed.toString()); + vti->setDBTextID(_TitleTextClosed); vti->setDynamicString(_TitleClass==TitleTextDynString); _TitleClosed = vti; } @@ -3796,7 +3796,7 @@ namespace NLGUI _TitleClosed->setY (pLayer->getValSInt32 ("title_offset_y")); } _TitleClosed->setFontSize (pLayer->getValSInt32 ("title_font_size")); - if (_TitleClass==TitleText) _TitleClosed->setText (_TitleTextClosed.toUtf8()); + if (_TitleClass==TitleText) _TitleClosed->setText (_TitleTextClosed); _TitleClosed->setActive(!_Opened); @@ -3949,83 +3949,119 @@ namespace NLGUI // *************************************************************************** std::string CGroupContainer::getTitle () const { - return _TitleTextOpened.toString(); + return _TitleTextOpened; } // *************************************************************************** void CGroupContainer::setTitle (const std::string &title) { - if (_Localize) setUCTitle (CI18N::get(title)); - else setUCTitle (title); + if (_Localize) setTitleRaw (CI18N::get(title)); + else setTitleRaw (title); } // *************************************************************************** std::string CGroupContainer::getTitleOpened () const { - return _TitleTextOpened.toString(); + return _TitleTextOpened; } // *************************************************************************** void CGroupContainer::setTitleOpened (const std::string &title) { - if (_Localize) setUCTitleOpened (CI18N::get(title)); - else setUCTitleOpened (title); + if (_Localize) setTitleOpenedRaw (CI18N::get(title)); + else setTitleOpenedRaw (title); } // *************************************************************************** std::string CGroupContainer::getTitleClosed () const { - return _TitleTextClosed.toString(); + return _TitleTextClosed; } // *************************************************************************** void CGroupContainer::setTitleClosed (const std::string &title) { - if (_Localize) setUCTitleClosed (CI18N::get(title)); - else setUCTitleClosed (title); + if (_Localize) setTitleClosedRaw (CI18N::get(title)); + else setTitleClosedRaw (title); } // *************************************************************************** - void CGroupContainer::setUCTitleOpened(const ucstring &title) + void CGroupContainer::setTitleOpenedRaw(const std::string &title) { _TitleTextOpened = title; if (_TitleOpened != NULL) - _TitleOpened->setText (title.toUtf8()); + _TitleOpened->setText (title); invalidateCoords(); } // *************************************************************************** - void CGroupContainer::setUCTitleClosed(const ucstring &title) + void CGroupContainer::setTitleClosedRaw(const std::string &title) { _TitleTextClosed = title; if (_TitleClosed != NULL) - _TitleClosed->setText (_TitleTextClosed.toUtf8()); + _TitleClosed->setText (_TitleTextClosed); invalidateCoords(); } + // *************************************************************************** + void CGroupContainer::setTitleRaw(const std::string &title) + { + setTitleOpenedRaw(title); + setTitleClosedRaw(title); + } + + // *************************************************************************** + std::string CGroupContainer::getTitleRaw () const + { + return getTitleOpened(); + } + + // *************************************************************************** + std::string CGroupContainer::getTitleOpenedRaw () const + { + return _TitleTextOpened; + } + + // *************************************************************************** + std::string CGroupContainer::getTitleClosedRaw () const + { + return _TitleTextClosed; + } + + // *************************************************************************** + void CGroupContainer::setUCTitleOpened(const ucstring &title) + { + setTitleOpenedRaw(title.toUtf8()); + } + + // *************************************************************************** + void CGroupContainer::setUCTitleClosed(const ucstring &title) + { + setTitleClosedRaw(title.toUtf8()); + } + // *************************************************************************** void CGroupContainer::setUCTitle(const ucstring &title) { - setUCTitleOpened(title); - setUCTitleClosed(title); + setTitleRaw(title.toUtf8()); } // *************************************************************************** ucstring CGroupContainer::getUCTitle () const { - return getUCTitleOpened(); + return ucstring::makeFromUtf8(getTitleRaw()); } // *************************************************************************** ucstring CGroupContainer::getUCTitleOpened () const { - return _TitleTextOpened; + return ucstring::makeFromUtf8(getTitleOpenedRaw()); } // *************************************************************************** ucstring CGroupContainer::getUCTitleClosed () const { - return _TitleTextClosed; + return ucstring::makeFromUtf8(getTitleClosedRaw()); } // *************************************************************************** diff --git a/nel/src/gui/group_editbox.cpp b/nel/src/gui/group_editbox.cpp index 768c69066..47a36d0a1 100644 --- a/nel/src/gui/group_editbox.cpp +++ b/nel/src/gui/group_editbox.cpp @@ -96,7 +96,7 @@ namespace NLGUI _ViewTextDeltaX(0) { - _Prompt = u32string(1, (u32char)'>'); + _Prompt = ::u32string(1, (u32char)'>'); _BackSelectColor= CRGBA::White; _TextSelectColor= CRGBA::Black; } @@ -264,9 +264,9 @@ namespace NLGUI std::string s; s.reserve( _NegativeFilter.size() ); - std::vector< char >::const_iterator itr; - for( itr = _NegativeFilter.begin(); itr != _NegativeFilter.end(); ++itr ) - s.push_back( *itr ); + std::vector< u32char >::const_iterator itr; + for (itr = _NegativeFilter.begin(); itr != _NegativeFilter.end(); ++itr) + CUtfStringView::append(s, *itr); return s; } @@ -450,10 +450,10 @@ namespace NLGUI if( name == "negative_filter" ) { _NegativeFilter.clear(); - - std::string::size_type i; - for( i = 0; i < value.size(); i++ ) - _NegativeFilter.push_back( value[ i ] ); + ::u32string::size_type i; + ::u32string ustr = CUtfStringView(value).toUtf32(); + for( i = 0; i < ustr.size(); i++ ) + _NegativeFilter.push_back(ustr[i]); } else CInterfaceGroup::setProperty( name, value ); @@ -539,9 +539,9 @@ namespace NLGUI std::string s; s.reserve( _NegativeFilter.size() ); - std::vector< char >::const_iterator itr; + std::vector< u32char >::const_iterator itr; for( itr = _NegativeFilter.begin(); itr != _NegativeFilter.end(); ++itr ) - s.push_back( *itr ); + CUtfStringView::append(s, *itr); xmlSetProp( node, BAD_CAST "negative_filter", BAD_CAST s.c_str() ); @@ -657,9 +657,11 @@ namespace NLGUI prop = (char*) xmlGetProp( cur, (xmlChar*)"negative_filter" ); if (prop) { - uint length = (uint)strlen(prop); - _NegativeFilter.resize(length); - std::copy((const char *) prop, (const char *) prop + length, _NegativeFilter.begin()); + _NegativeFilter.clear(); + ::u32string::size_type i; + ::u32string ustr = CUtfStringView(prop).toUtf32(); + for( i = 0; i < ustr.size(); i++ ) + _NegativeFilter.push_back(ustr[i]); } return true; @@ -829,10 +831,10 @@ namespace NLGUI // ---------------------------------------------------------------------------- void CGroupEditBox::writeString(const ucstring &str16, bool replace, bool atEnd) { - u32string str = CUtfStringView(str16).toUtf32(); + ::u32string str = CUtfStringView(str16).toUtf32(); sint length = (sint)str.length(); - u32string toAppend; + ::u32string toAppend; // filter character depending on the entry type switch (_EntryType) { @@ -854,7 +856,7 @@ namespace NLGUI } } // remove '\r' characters - toAppend.erase(std::remove(toAppend.begin(), toAppend.end(), (ucchar) '\r'), toAppend.end()); + toAppend.erase(std::remove(toAppend.begin(), toAppend.end(), (u32char) '\r'), toAppend.end()); } break; @@ -965,7 +967,7 @@ namespace NLGUI { length = _MaxNumChar - (sint)_InputString.length(); } - u32string toAdd = toAppend.substr(0, length); + ::u32string toAdd = toAppend.substr(0, length); sint32 minPos; sint32 maxPos; if (_CurrSelection == this) @@ -1015,7 +1017,7 @@ namespace NLGUI _CursorAtPreviousLineEnd = false; if (_ClearOnEscape) { - setInputStringAsUtf32(u32string()); + setInputStringAsUtf32(::u32string()); triggerOnChangeAH(); } CWidgetManager::getInstance()->setCaptureKeyboard(NULL); @@ -1077,7 +1079,7 @@ namespace NLGUI cutSelection(); } - ucchar c = isKeyRETURN ? '\n' : rEDK.getChar(); + u32char c = isKeyRETURN ? '\n' : rEDK.getChar(); if (isFiltered(c)) return; switch(_EntryType) { @@ -1124,8 +1126,8 @@ namespace NLGUI if(_EntryType==Integer && (_IntegerMinValue!=INT_MIN || _IntegerMaxValue!=INT_MAX)) { // estimate new string - u32string copyStr= _InputString; - u32string::iterator it = copyStr.begin() + _CursorPos; + ::u32string copyStr= _InputString; + ::u32string::iterator it = copyStr.begin() + _CursorPos; copyStr.insert(it, c); sint32 value; fromString(CUtfStringView(copyStr).toUtf8(), value); @@ -1137,8 +1139,8 @@ namespace NLGUI if(_EntryType==PositiveInteger && (_PositiveIntegerMinValue!=0 || _PositiveIntegerMaxValue!=UINT_MAX)) { // estimate new string - u32string copyStr= _InputString; - u32string::iterator it = copyStr.begin() + _CursorPos; + ::u32string copyStr= _InputString; + ::u32string::iterator it = copyStr.begin() + _CursorPos; copyStr.insert(it, c); // \todo yoyo: this doesn't really work i think.... uint32 value; @@ -1151,7 +1153,7 @@ namespace NLGUI if ((uint) _InputString.length() < _MaxNumChar) { makeTopWindow(); - u32string::iterator it = _InputString.begin() + _CursorPos; + ::u32string::iterator it = _InputString.begin() + _CursorPos; _InputString.insert(it, c); ++ _CursorPos; triggerOnChangeAH(); @@ -1263,7 +1265,7 @@ namespace NLGUI // else delete last character else if(_InputString.size () > 0 && _CursorPos != 0) { - u32string::iterator it = _InputString.begin() + (_CursorPos - 1); + ::u32string::iterator it = _InputString.begin() + (_CursorPos - 1); _InputString.erase(it); -- _CursorPos; _CursorAtPreviousLineEnd = false; @@ -1436,7 +1438,7 @@ namespace NLGUI std::string usTmp; if (_EntryType == Password) { - usTmp = CUtfStringView(_Prompt + u32string(_InputString.size(), 0x2022)).toUtf8(); + usTmp = CUtfStringView(_Prompt + ::u32string(_InputString.size(), 0x2022)).toUtf8(); } else { @@ -1634,7 +1636,7 @@ namespace NLGUI { setInputStringAsUtf32(CUtfStringView(str).toUtf32()); } - void CGroupEditBox::setInputStringAsUtf32(const u32string &str) + void CGroupEditBox::setInputStringAsUtf32(const ::u32string &str) { _InputString = str; if (_CursorPos > (sint32) str.length()) @@ -1650,10 +1652,10 @@ namespace NLGUI // *************************************************************************** - void CGroupEditBox::setDefaultInputString(const ucstring &str) + void CGroupEditBox::setDefaultInputString(const std::string &str) { _DefaultInputString= true; - setInputStringAsUtf32(CUtfStringView(str).toUtf32()); + setInputString(str); } // *************************************************************************** @@ -1771,14 +1773,14 @@ namespace NLGUI } // *************************************************************************** - void CGroupEditBox::setCommand(const ucstring &command, bool execute) + void CGroupEditBox::setCommand(const std::string &command, bool execute) { // do nothing if frozen if(_Frozen) return; // set the string and maybe execute - setInputStringAsUtf16((ucchar) '/' + command); + setInputString('/' + command); if (execute) { // stop selection @@ -1878,7 +1880,7 @@ namespace NLGUI void CGroupEditBox::onQuit() { // clear the text and restore backup pos before final save - setInputStringAsUtf32(u32string()); + setInputStringAsUtf32(::u32string()); _CurrSelection = NULL; } @@ -1886,7 +1888,7 @@ namespace NLGUI void CGroupEditBox::onLoadConfig() { // config is not saved when there's an empty string, so restore that default state. - setInputStringAsUtf32(u32string()); + setInputStringAsUtf32(::u32string()); _CurrSelection = NULL; _PrevNumLine = 1; } @@ -1901,7 +1903,7 @@ namespace NLGUI if (_DefaultInputString) { _DefaultInputString= false; - setInputStringAsUtf32(u32string()); + setInputStringAsUtf32(::u32string()); } _CanRedo = false; _CanUndo = false; diff --git a/nel/src/gui/group_html.cpp b/nel/src/gui/group_html.cpp index e6b1ba473..f7a62cc90 100644 --- a/nel/src/gui/group_html.cpp +++ b/nel/src/gui/group_html.cpp @@ -1034,7 +1034,7 @@ namespace NLGUI // *************************************************************************** - void CGroupHTML::addText (const char * buf, int len) + void CGroupHTML::addText (const char *buf, int len) { if (_Browsing) { @@ -1042,44 +1042,43 @@ namespace NLGUI return; // Build a UTF8 string - string inputString(buf, buf+len); - if (_ParsingLua && _TrustedDomain) { // we are parsing a lua script - _LuaScript += inputString; + _LuaScript += string(buf, buf + len); // no more to do return; } // Build a unicode string - ucstring inputUCString; - inputUCString.fromUtf8(inputString); + CUtfStringView inputStringView(buf, len); // Build the final unicode string - ucstring tmp; + string tmp; tmp.reserve(len); - uint ucLen = (uint)inputUCString.size(); - for (uint i=0; igetModulateGlobalColor())) { // Concat the text - _CurrentViewLink->setText(_CurrentViewLink->getText()+tmpStr.toUtf8()); + _CurrentViewLink->setText(_CurrentViewLink->getText()+tmpStr); _CurrentViewLink->invalidateContent(); added = true; } @@ -2888,7 +2887,7 @@ namespace NLGUI ctrlButton->setModulateGlobalColorAll (false); // Translate the tooltip - ctrlButton->setDefaultContextHelp(ucstring::makeFromUtf8(getLinkTitle())); + ctrlButton->setDefaultContextHelp(getLinkTitle()); ctrlButton->setText(tmpStr); // empty url / button disabled bool disabled = string(getLink()).empty(); @@ -2916,7 +2915,7 @@ namespace NLGUI newLink->setParamsOnLeftClick("name=" + getId() + "|url=" + newLink->Link); } } - newLink->setText(tmpStr.toUtf8()); + newLink->setText(tmpStr); newLink->setMultiLineSpace((uint)((float)(style.FontSize)*LineSpaceFontFactor)); newLink->setMultiLine(true); newLink->setModulateGlobalColor(style.GlobalColor); @@ -2968,7 +2967,7 @@ namespace NLGUI // *************************************************************************** - CInterfaceGroup *CGroupHTML::addTextArea(const std::string &templateName, const char *name, uint rows, uint cols, bool multiLine, const ucstring &content, uint maxlength) + CInterfaceGroup *CGroupHTML::addTextArea(const std::string &templateName, const char *name, uint rows, uint cols, bool multiLine, const std::string &content, uint maxlength) { // In a paragraph ? if (!_Paragraph) @@ -3024,7 +3023,7 @@ namespace NLGUI CGroupEditBox *eb = dynamic_cast(textArea->getGroup("eb")); if (eb) { - eb->setInputString(CUtfStringView(decodeHTMLEntities(content)).toUtf8()); + eb->setInputString(decodeHTMLEntities(content)); if (style.hasStyle("background-color")) { CViewBitmap *bg = dynamic_cast(eb->getView("bg")); @@ -3234,7 +3233,7 @@ namespace NLGUI } else { - ctrlButton->setDefaultContextHelp(ucstring::makeFromUtf8(tooltip)); + ctrlButton->setDefaultContextHelp(tooltip); //ctrlButton->setOnContextHelp(string(tooltip)); } @@ -3310,7 +3309,7 @@ namespace NLGUI { if (_CurrentViewLink) { - u32string str = CUtfStringView(_CurrentViewLink->getText()).toUtf32(); // FIXME: Optimize reverse UTF iteration + ::u32string str = CUtfStringView(_CurrentViewLink->getText()).toUtf32(); // FIXME: Optimize reverse UTF iteration if (!str.empty()) return str[str.length()-1]; } @@ -3402,7 +3401,7 @@ namespace NLGUI // *************************************************************************** - void CGroupHTML::setTitle (const ucstring &title) + void CGroupHTML::setTitleRaw (const std::string &title) { CInterfaceElement *parent = getParent(); if (parent) @@ -3412,7 +3411,7 @@ namespace NLGUI CGroupContainer *container = dynamic_cast(parent); if (container) { - container->setUCTitle (title); + container->setTitleRaw (title); } } } @@ -3420,21 +3419,18 @@ namespace NLGUI void CGroupHTML::setTitle(const std::string &title) { - ucstring uctitle; - uctitle.fromUtf8(title); - _TitleString.clear(); if(!_TitlePrefix.empty()) { _TitleString = _TitlePrefix + " - "; } - _TitleString += uctitle; + _TitleString += title; - setTitle(_TitleString); + setTitleRaw(_TitleString); } std::string CGroupHTML::getTitle() const { - return _TitleString.toUtf8(); + return _TitleString; }; // *************************************************************************** @@ -4685,9 +4681,7 @@ namespace NLGUI CLuaIHM::checkArgType(ls, funcName, 3, LUA_TBOOLEAN); string name = ls.toString(1); - - ucstring text; - text.fromUtf8(ls.toString(2)); + string text = ls.toString(2); if (!_Forms.empty()) { @@ -4717,7 +4711,7 @@ namespace NLGUI const char *funcName = "addString"; CLuaIHM::checkArgCount(ls, funcName, 1); CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING); - addString(ucstring::makeFromUtf8(ls.toString(1))); + addString(ls.toString(1)); return 0; } @@ -4945,7 +4939,7 @@ namespace NLGUI } // *************************************************************************** - inline bool isDigit(ucchar c, uint base = 16) + inline bool isDigit(char c, uint base = 16) { if (c>='0' && c<='9') return true; if (base != 16) return false; @@ -4955,7 +4949,7 @@ namespace NLGUI } // *************************************************************************** - inline ucchar convertHexDigit(ucchar c) + inline char convertHexDigit(char c) { if (c>='0' && c<='9') return c-'0'; if (c>='A' && c<='F') return c-'A'+10; @@ -4964,9 +4958,10 @@ namespace NLGUI } // *************************************************************************** - ucstring CGroupHTML::decodeHTMLEntities(const ucstring &str) + std::string CGroupHTML::decodeHTMLEntities(const std::string &str) { - ucstring result; + std::string result; + result.reserve(str.size() + (str.size() >> 2)); uint last, pos; for (uint i=0; isetDefaultContextHelp(ucstring::makeFromUtf8(tooltip)); + ctrlButton->setDefaultContextHelp(tooltip); } } - ctrlButton->setText(ucstring::makeFromUtf8(value)); + ctrlButton->setText(value); setTextButtonStyle(ctrlButton, _Style.Current); } @@ -5563,8 +5558,7 @@ namespace NLGUI { if (!_Paragraph || _Paragraph->getNumChildren() == 0) { - ucstring tmp("\n"); - addString(tmp); + addString("\n"); } else { @@ -6086,8 +6080,7 @@ namespace NLGUI { // Get the string name string name = elm.getAttribute("name"); - ucstring ucValue; - ucValue.fromUtf8(elm.getAttribute("value")); + string ucValue = elm.getAttribute("value"); uint size = 20; uint maxlength = 1024; @@ -6121,12 +6114,12 @@ namespace NLGUI string normal = elm.getAttribute("src"); string pushed; string over; - ucstring ucValue = ucstring("on"); + string ucValue = "on"; bool checked = elm.hasAttribute("checked"); // TODO: unknown if empty attribute should override or not if (elm.hasNonEmptyAttribute("value")) - ucValue.fromUtf8(elm.getAttribute("value")); + ucValue = elm.getAttribute("value"); if (type == "radio") { @@ -6191,8 +6184,7 @@ namespace NLGUI string name = elm.getAttribute("name"); // Get the value - ucstring ucValue; - ucValue.fromUtf8(elm.getAttribute("value")); + string ucValue = elm.getAttribute("value"); // Add an entry CGroupHTML::CForm::CEntry entry; @@ -6224,8 +6216,7 @@ namespace NLGUI if (elm.hasNonEmptyAttribute("value")) fromString(elm.getAttribute("value"), _UL.back().Value); - ucstring str; - str.fromUtf8(_UL.back().getListMarkerText()); + string str = _UL.back().getListMarkerText(); addString (str); // list-style-type: outside @@ -6429,7 +6420,7 @@ namespace NLGUI // use option text as value if (!elm.hasAttribute("value")) { - _Forms.back().Entries.back().SelectValues.back() = _SelectOptionStr.toUtf8(); + _Forms.back().Entries.back().SelectValues.back() = _SelectOptionStr; } // insert the parsed text into the select control @@ -6437,7 +6428,7 @@ namespace NLGUI if (cb) { uint lineIndex = cb->getNumTexts(); - cb->addText(_SelectOptionStr.toUtf8()); + cb->addText(_SelectOptionStr); if (_Forms.back().Entries.back().sbOptionDisabled == lineIndex) { cb->setGrayed(lineIndex, true); diff --git a/nel/src/gui/group_list.cpp b/nel/src/gui/group_list.cpp index 4e04501a8..b94ff6a5f 100644 --- a/nel/src/gui/group_list.cpp +++ b/nel/src/gui/group_list.cpp @@ -521,7 +521,7 @@ namespace NLGUI if (NLMISC::startsWith(propPtr, "ui")) addTextChild(CI18N::get(propPtr)); else - addTextChild(ucstring::makeFromUtf8(propPtr)); + addTextChild(propPtr); } else { @@ -539,7 +539,7 @@ namespace NLGUI // ---------------------------------------------------------------------------- - void CGroupList::addTextChild(const ucstring& line, bool multiLine /*= true*/) + void CGroupList::addTextChild(const std::string& line, bool multiLine /*= true*/) { const string elid = _Id + ":el" + toString(_IdCounter); ++_IdCounter; CViewText *view= new CViewText (elid, string(""), _Templ.getFontSize(), _Templ.getColor(), _Templ.getShadow()); @@ -548,7 +548,7 @@ namespace NLGUI view->setMultiLine (multiLine); view->setTextMode(_Templ.getTextMode()); if (multiLine) view->setMultiLineSpace (_Space); - view->setText (line.toUtf8()); + view->setText (line); // Herit global-coloring view->setModulateGlobalColor(getModulateGlobalColor()); addChild(view); @@ -558,7 +558,7 @@ namespace NLGUI // ---------------------------------------------------------------------------- - void CGroupList::addTextChild(const ucstring& line, const CRGBA& textColor, bool multiLine /*= true*/) + void CGroupList::addTextChild(const std::string& line, const CRGBA& textColor, bool multiLine /*= true*/) { const string elid = _Id + ":el" + toString(_IdCounter); ++_IdCounter; CViewText *view= new CViewText (elid, string(""), _Templ.getFontSize(), _Templ.getColor(), _Templ.getShadow()); @@ -566,7 +566,7 @@ namespace NLGUI view->_Parent = this; view->setMultiLine (multiLine); if (multiLine) view->setMultiLineSpace (_Space); - view->setText (line.toUtf8()); + view->setText (line); view->setColor (textColor); // Herit global-coloring view->setModulateGlobalColor(getModulateGlobalColor()); @@ -1289,7 +1289,7 @@ namespace NLGUI ucstring text; if(CLuaIHM::pop(ls, text)) { - addTextChild(text); + addTextChild(text.toUtf8()); // FIXME: Lua UTF-8 } return 0; } @@ -1313,7 +1313,7 @@ namespace NLGUI uint b = (uint) ls.toInteger(4); uint a = (uint) ls.toInteger(5); - addTextChild(ucText, CRGBA(r, g, b, a)); + addTextChild(ucText.toUtf8(), CRGBA(r, g, b, a)); // FIXME: Lua UTF-8 return 0; } diff --git a/nel/src/gui/group_menu.cpp b/nel/src/gui/group_menu.cpp index 109baf278..77f73e18e 100644 --- a/nel/src/gui/group_menu.cpp +++ b/nel/src/gui/group_menu.cpp @@ -275,7 +275,7 @@ namespace NLGUI if (stricmp((char*)cur->name, "action") == 0) { string strId, strAh, strParams, strCond, strTexture; - ucstring ucstrName; + string ucstrName; if (id) strId = (const char*)id; CXMLAutoPtr name((const char*) xmlGetProp (cur, (xmlChar*)"name")); @@ -286,7 +286,7 @@ namespace NLGUI if (NLMISC::startsWith(ptrName, "ui")) ucstrName = CI18N::get(ptrName); else - ucstrName.fromUtf8(ptrName); + ucstrName = ptrName; } CXMLAutoPtr ah((const char*) xmlGetProp (cur, (xmlChar*)"handler")); @@ -1215,7 +1215,7 @@ namespace NLGUI // ------------------------------------------------------------------------------------------------ - CViewTextMenu* CGroupSubMenu::addLine (const ucstring &name, const std::string &ah, + CViewTextMenu* CGroupSubMenu::addLine (const std::string &name, const std::string &ah, const std::string ¶ms, const std::string &id, const std::string &cond, const std::string &texture, bool checkable /*= false*/, bool checked /*= false*/, bool formatted /*= false */ @@ -1231,11 +1231,11 @@ namespace NLGUI { pV->setMultiLine (true); pV->setMultiLineMaxWOnly (true); - pV->setTextFormatTaged (name.toUtf8()); + pV->setTextFormatTaged (name); } else { - pV->setText (name.toUtf8()); + pV->setText (name); } pV->setColor (_GroupMenu->_Color); pV->setFontSize (_GroupMenu->_FontSize, _GroupMenu->_FontSizeCoef); @@ -1296,7 +1296,7 @@ namespace NLGUI return pV; } - CViewTextMenu* CGroupSubMenu::addLineAtIndex(uint index, const ucstring &name, const std::string &ah, + CViewTextMenu* CGroupSubMenu::addLineAtIndex(uint index, const std::string &name, const std::string &ah, const std::string ¶ms, const std::string &id /*=""*/, const std::string &cond /*=std::string()*/, const std::string &texture, bool checkable /*= false*/, bool checked /*= false*/, bool formatted /*= false */ @@ -1319,11 +1319,11 @@ namespace NLGUI { pV->setMultiLine (true); pV->setMultiLineMaxWOnly (true); - pV->setTextFormatTaged (name.toUtf8()); + pV->setTextFormatTaged (name); } else { - pV->setText (name.toUtf8()); + pV->setText (name); } pV->setColor (_GroupMenu->_Color); @@ -1602,7 +1602,7 @@ namespace NLGUI texture = _Lines[k].ViewText->getCheckBox()->getTexture(); } CViewTextMenu *pV = NULL; - pV = copyMenu->addLine (CUtfStringView(_Lines[k].ViewText->getText()).toUtf16(), _Lines[k].AHName, _Lines[k].AHParams, _Lines[k].Id, _Lines[k].Cond, + pV = copyMenu->addLine (_Lines[k].ViewText->getText(), _Lines[k].AHName, _Lines[k].AHParams, _Lines[k].Id, _Lines[k].Cond, texture, _Lines[k].ViewText->getCheckable(), _Lines[k].ViewText->getChecked(), _Lines[k].ViewText->getFormatted ()); copyMenu->_Lines[k].Selectable = _Lines[k].Selectable; pV->setGrayed(_Lines[k].ViewText->getGrayed()); @@ -1858,8 +1858,8 @@ namespace NLGUI CLuaIHM::checkArgType(ls, funcName, 3, LUA_TSTRING); CLuaIHM::checkArgType(ls, funcName, 4, LUA_TSTRING); ucstring arg1; - nlverify(CLuaIHM::getUCStringOnStack(ls, 1, arg1)); - addLine(arg1, ls.toString(2), ls.toString(3), ls.toString(4)); + nlverify(CLuaIHM::getUCStringOnStack(ls, 1, arg1)); // FIXME: Lua UTF-8 + addLine(arg1.toUtf8(), ls.toString(2), ls.toString(3), ls.toString(4)); return 0; } @@ -1874,8 +1874,8 @@ namespace NLGUI CLuaIHM::checkArgType(ls, funcName, 4, LUA_TSTRING); CLuaIHM::checkArgType(ls, funcName, 5, LUA_TSTRING); ucstring arg1; - nlverify(CLuaIHM::getUCStringOnStack(ls, 1, arg1)); - addLine(arg1, ls.toString(2), ls.toString(3), ls.toString(4), string(), ls.toString(5)); + nlverify(CLuaIHM::getUCStringOnStack(ls, 1, arg1)); // FIXME: Lua UTF-8 + addLine(arg1.toUtf8(), ls.toString(2), ls.toString(3), ls.toString(4), string(), ls.toString(5)); return 0; } @@ -1890,8 +1890,8 @@ namespace NLGUI CLuaIHM::checkArgType(ls, funcName, 4, LUA_TSTRING); CLuaIHM::checkArgType(ls, funcName, 5, LUA_TSTRING); ucstring arg2; - nlverify(CLuaIHM::getUCStringOnStack(ls, 2, arg2)); - addLineAtIndex((uint) ls.toInteger(1), arg2, ls.toString(3), ls.toString(4), ls.toString(5)); + nlverify(CLuaIHM::getUCStringOnStack(ls, 2, arg2)); // FIXME: Lua UTF-8 + addLineAtIndex((uint) ls.toInteger(1), arg2.toUtf8(), ls.toString(3), ls.toString(4), ls.toString(5)); return 0; } @@ -2532,25 +2532,7 @@ namespace NLGUI } // ------------------------------------------------------------------------------------------------ - void CGroupMenu::addLine (const string &name, const string &ah, const string ¶ms, - const std::string &id/*=std::string()*/, - const std::string &cond /*= std::string()*/, const std::string &texture, - bool checkable /*= false*/, bool checked /*= false*/ - ) - { - if (_RootMenu == NULL) - { - _RootMenu = new CGroupSubMenu(CViewText::TCtorParam()); - _RootMenu->_GroupMenu = this; - _RootMenu->setSerializable( false ); - addGroup (_RootMenu); - } - - _RootMenu->addLine (name, ah, params, id, cond, texture, checkable, checked, _Formatted); - } - - // ------------------------------------------------------------------------------------------------ - void CGroupMenu::addLine(const ucstring &name, const std::string &ah, const std::string ¶ms, + void CGroupMenu::addLine(const std::string &name, const std::string &ah, const std::string ¶ms, const std::string &id /* = std::string()*/, const std::string &cond /*= std::string()*/, const std::string &texture, bool checkable /*= false*/, bool checked /*= false*/ @@ -2566,7 +2548,7 @@ namespace NLGUI _RootMenu->addLine (name, ah, params, id, cond, texture, checkable, checked, _Formatted); } // ------------------------------------------------------------------------------------------------ - void CGroupMenu::addLineAtIndex(uint index, const ucstring &name, const std::string &ah, + void CGroupMenu::addLineAtIndex(uint index, const std::string &name, const std::string &ah, const std::string ¶ms, const std::string &id /*=std::string()*/, const std::string &cond /*=std::string()*/, const std::string &texture, bool checkable /*=false*/, bool checked /*=false*/) diff --git a/nel/src/gui/group_paragraph.cpp b/nel/src/gui/group_paragraph.cpp index f2027a404..a4c2a6da7 100644 --- a/nel/src/gui/group_paragraph.cpp +++ b/nel/src/gui/group_paragraph.cpp @@ -479,7 +479,7 @@ namespace NLGUI if (NLMISC::startsWith(propPtr, "ui")) addTextChild(CI18N::get(propPtr)); else - addTextChild(ucstring::makeFromUtf8(propPtr)); + addTextChild(propPtr); } else { @@ -495,7 +495,7 @@ namespace NLGUI } // ---------------------------------------------------------------------------- - void CGroupParagraph::addTextChild(const ucstring& line, bool multiLine /*= true*/) + void CGroupParagraph::addTextChild(const std::string& line, bool multiLine /*= true*/) { const string elid = _Id + ":el" + toString(_IdCounter); ++_IdCounter; CViewText *view= new CViewText (elid, string(""), _Templ.getFontSize(), _Templ.getColor(), _Templ.getShadow()); @@ -503,7 +503,7 @@ namespace NLGUI view->setMultiLine (multiLine); view->setTextMode(_Templ.getTextMode()); if (multiLine) view->setMultiLineSpace (_Space); - view->setText (line.toUtf8()); + view->setText (line); // Herit global-coloring view->setModulateGlobalColor(getModulateGlobalColor()); addChild (view); @@ -513,14 +513,14 @@ namespace NLGUI // ---------------------------------------------------------------------------- - void CGroupParagraph::addTextChild(const ucstring& line, const CRGBA& textColor, bool multiLine /*= true*/) + void CGroupParagraph::addTextChild(const std::string& line, const CRGBA& textColor, bool multiLine /*= true*/) { const string elid = _Id + ":el" + toString(_IdCounter); ++_IdCounter; CViewText *view= new CViewText (elid, string(""), _Templ.getFontSize(), _Templ.getColor(), _Templ.getShadow()); view->_Parent = this; view->setMultiLine (multiLine); if (multiLine) view->setMultiLineSpace (_Space); - view->setText (line.toUtf8()); + view->setText (line); view->setColor (textColor); // Herit global-coloring view->setModulateGlobalColor(getModulateGlobalColor()); diff --git a/nel/src/gui/group_tree.cpp b/nel/src/gui/group_tree.cpp index 93e9880bb..674da9546 100644 --- a/nel/src/gui/group_tree.cpp +++ b/nel/src/gui/group_tree.cpp @@ -309,7 +309,7 @@ namespace NLGUI if (NLMISC::startsWith(ptrName, "ui")) Text = CI18N::get(ptrName); else - ucstring::makeFromUtf8(ptrName); + Text = ptrName; } CXMLAutoPtr color((const char*) xmlGetProp (cur, (xmlChar*)"color")); @@ -1292,7 +1292,7 @@ namespace NLGUI CViewText *pVT = new CViewText(TCtorParam()); line.TextOrTemplate = pVT; pVT->setId("t"+toString(_Lines.size())); - pVT->setText(pNode->Text.toUtf8()); + pVT->setText(pNode->Text); pVT->setColor(pNode->Color); if(pNode->FontSize==-1) pVT->setFontSize(_FontSize); diff --git a/nel/src/gui/interface_expr.cpp b/nel/src/gui/interface_expr.cpp index 813962526..c83c1d722 100644 --- a/nel/src/gui/interface_expr.cpp +++ b/nel/src/gui/interface_expr.cpp @@ -548,7 +548,7 @@ namespace NLGUI case Boolean: return true; case Integer: setBool(_IntegerValue != 0); return true; case Double: setBool(_DoubleValue != 0); return true; - case String: return evalBoolean(_StringValue.toString().c_str()) != NULL; + case String: return evalBoolean(_StringValue.c_str()) != NULL; default: break; } return false; @@ -564,7 +564,7 @@ namespace NLGUI case Integer: return true; case Double: setInteger((sint64) _DoubleValue); return true; case String: - if (evalNumber(_StringValue.toString().c_str())) return toInteger(); + if (evalNumber(_StringValue.c_str())) return toInteger(); return false; case RGBA: setInteger((sint64) _RGBAValue); return true; default: break; @@ -581,7 +581,7 @@ namespace NLGUI case Integer: setDouble((double) _IntegerValue); return true; case Double: return true; case String: - if (evalNumber(_StringValue.toString().c_str())) return toBool(); + if (evalNumber(_StringValue.c_str())) return toBool(); return false; case RGBA: setDouble((double) _RGBAValue); return true; default: break; @@ -627,7 +627,7 @@ namespace NLGUI return true; case String: - setRGBA( NLMISC::CRGBA::stringToRGBA(_StringValue.toString().c_str())); + setRGBA( NLMISC::CRGBA::stringToRGBA(_StringValue.c_str())); return true; default: @@ -869,14 +869,15 @@ namespace NLGUI } //================================================================== - std::string CInterfaceExprValue::getString() const + const std::string &CInterfaceExprValue::getString() const { if (_Type != String) { nlwarning(" bad type!"); - return ""; + static const std::string empty; + return empty; } - return _StringValue.toString(); + return _StringValue; } //================================================================== @@ -895,19 +896,6 @@ namespace NLGUI return col; } - - //================================================================== - const ucstring &CInterfaceExprValue::getUCString() const - { - if (_Type != String) - { - nlwarning(" bad type!"); - static ucstring emptyString; - return emptyString; - } - return _StringValue; - } - //================================================================== CInterfaceExprUserType *CInterfaceExprValue::getUserType() const { diff --git a/nel/src/gui/interface_expr_user_fct.cpp b/nel/src/gui/interface_expr_user_fct.cpp index d0c687d26..7fc097f48 100644 --- a/nel/src/gui/interface_expr_user_fct.cpp +++ b/nel/src/gui/interface_expr_user_fct.cpp @@ -359,13 +359,13 @@ namespace NLGUI { if (!args.empty()) { - ucstring res; + string res; for (uint32 i = 0; i < args.size(); ++i) { args[i].toString(); - res += args[i].getUCString(); + res += args[i].getString(); } - result.setUCString (res); + result.setString (res); return true; } @@ -553,13 +553,13 @@ namespace NLGUI result.setString ((elem->*(pRP->GetMethod.GetString))()); break; case CReflectedProperty::UCString: - result.setUCString ((elem->*(pRP->GetMethod.GetUCString))()); + result.setString ((elem->*(pRP->GetMethod.GetUCString))().toUtf8()); break; case CReflectedProperty::StringRef: result.setString ((elem->*(pRP->GetMethod.GetStringRef))()); break; case CReflectedProperty::UCStringRef: - result.setUCString ((elem->*(pRP->GetMethod.GetUCStringRef))()); + result.setString ((elem->*(pRP->GetMethod.GetUCStringRef))().toUtf8()); break; case CReflectedProperty::RGBA: result.setRGBA ((elem->*(pRP->GetMethod.GetRGBA))()); @@ -1072,7 +1072,7 @@ namespace NLGUI } sint64 nVal = args[0].getInteger(); - ucstring sTmp; + string sTmp; if (nVal < 0) nVal = 0; @@ -1099,7 +1099,7 @@ namespace NLGUI } } - result.setUCString(sTmp); + result.setString(sTmp); return true; } @@ -1121,7 +1121,7 @@ namespace NLGUI } sint64 nVal = args[0].getInteger(); - ucstring sTmp; + string sTmp; if (nVal < 0) nVal = 0; @@ -1150,7 +1150,7 @@ namespace NLGUI } } - result.setUCString(sTmp); + result.setString(sTmp); return true; } @@ -1186,7 +1186,7 @@ namespace NLGUI nlwarning("localize : 1 arg required"); return false; } - result.setUCString(CI18N::get(args[0].getString())); + result.setString(CI18N::get(args[0].getString())); return true; } REGISTER_INTERFACE_USER_FCT("localize", localize); diff --git a/nel/src/gui/interface_link.cpp b/nel/src/gui/interface_link.cpp index 03a1212d3..1cad39c94 100644 --- a/nel/src/gui/interface_link.cpp +++ b/nel/src/gui/interface_link.cpp @@ -121,7 +121,7 @@ namespace NLGUI case CReflectedProperty::UCStringRef: if (valueToAffect.toString()) { - (destElem.*(property.SetMethod.SetUCString))(valueToAffect.getUCString()); + (destElem.*(property.SetMethod.SetUCString))(ucstring::makeFromUtf8(valueToAffect.getString())); } else { diff --git a/nel/src/gui/lua_ihm.cpp b/nel/src/gui/lua_ihm.cpp index cf60444a6..c915a8671 100644 --- a/nel/src/gui/lua_ihm.cpp +++ b/nel/src/gui/lua_ihm.cpp @@ -1145,34 +1145,8 @@ namespace NLGUI ls.push(value.getDouble()); break; case CInterfaceExprValue::String: - { - ucstring ucstr= value.getUCString(); - // Yoyo: dynamically decide whether must return a string or a ucstring - bool mustUseUCString= false; - for (uint i = 0; i < ucstr.size (); i++) - { - if (ucstr[i] > 255) - { - mustUseUCString= true; - break; - } - } - // push a ucstring? - if(mustUseUCString) - { - #if LUABIND_VERSION > 600 - luabind::detail::push(ls.getStatePointer(), ucstr); - #else - luabind::object obj(ls.getStatePointer(), ucstr); - obj.pushvalue(); - #endif - } - else - { - ls.push(ucstr.toString()); - } - break; - } + ls.push(value.getString()); + break; case CInterfaceExprValue::RGBA: { CRGBA color = value.getRGBA(); @@ -1691,7 +1665,7 @@ namespace NLGUI // inside i18n table luabind::module(L, "i18n") [ - luabind::def("get", &CI18N::get), + luabind::def("get", &CI18N::getAsUtf16), // FIXME: Lua UTF-8 luabind::def("hasTranslation", &CI18N::hasTranslation) ]; // inside 'nlfile' table diff --git a/nel/src/gui/string_case.cpp b/nel/src/gui/string_case.cpp index d970d1e03..8946a5d1d 100644 --- a/nel/src/gui/string_case.cpp +++ b/nel/src/gui/string_case.cpp @@ -32,18 +32,6 @@ namespace NLGUI return (c == (u32char)' ') || (c == (u32char)'\t') || (c == (u32char)'\n') || (c == (u32char)'\r'); } - inline bool isSeparator (ucchar c) - { - return (c == ' ') || (c == '\t') || (c == '\n') || (c == '\r'); - } - - inline bool isSeparator (char c) - { - return (c == ' ') || (c == '\t') || (c == '\n') || (c == '\r'); - } - - // *************************************************************************** - inline bool isEndSentence (u32char c, u32char lastChar) { // Ex: One sentence. Another sentence. @@ -54,90 +42,6 @@ namespace NLGUI && (lastChar == (u32char)'.') || (lastChar == (u32char)'!') || (lastChar == (u32char)'?'); } - inline bool isEndSentence (ucstring& str, uint index) - { - // Ex: One sentence. Another sentence. - // ^ - // Counterexample: nevrax.com - // ^ - ucchar c = str[index]; - if ((str[index] == ' ') || (str[index] == '\n')) - { - if (index < 1) - return false; - c = str[index-1]; - return (c == '.') || (c == '!') || (c == '?'); - } - return false; - } - - - void setCase( ucstring &str, TCaseMode mode ) - { - const uint length = (uint)str.length(); - uint i; - bool newString = true; - bool newSentence = true; - bool newWord = true; - switch (mode) - { - case CaseLower: - str = NLMISC::toLower (str); - break; - case CaseUpper: - str = NLMISC::toUpper (str); - break; - case CaseFirstStringLetterUp: - for (i=0; igetMouseOverShape(tooltip, rot, col)) { - setString(ucstring::makeFromUtf8(tooltip)); + setString(tooltip); sint32 texId = rVR.getTextureIdFromName ("curs_pick.tga"); CInterfaceGroup *stringCursor = hwMouse ? _StringCursorHardware : _StringCursor; @@ -406,7 +406,7 @@ namespace NLGUI splitString(tooltipInfos, "@", tooltipInfosList); texName = tooltipInfosList[0]; tooltip = tooltipInfosList[1]; - setString(ucstring::makeFromUtf8(tooltip)); + setString(tooltip); CViewRenderer &rVR = *CViewRenderer::getInstance(); sint32 texId = rVR.getTextureIdFromName (texName); @@ -449,7 +449,7 @@ namespace NLGUI } // -------------------------------------------------------------------------------------------------------------------- - void CViewPointer::setString (const ucstring &str, CInterfaceGroup *target) + void CViewPointer::setString(const std::string &str, CInterfaceGroup *target) { if (target) { @@ -458,14 +458,14 @@ namespace NLGUI { CViewText *text = dynamic_cast (element); if (text) - text->setText(str.toUtf8()); + text->setText(str); } element = target->getView ("real_txt"); if (element) { CViewText *text = dynamic_cast (element); if (text) - text->setText(str.toUtf8()); + text->setText(str); } target->updateCoords(); target->updateCoords(); @@ -475,7 +475,7 @@ namespace NLGUI // -------------------------------------------------------------------------------------------------------------------- - void CViewPointer::setString (const ucstring &str) + void CViewPointer::setString (const std::string &str) { if (_ContextString != str) { diff --git a/nel/src/gui/view_text.cpp b/nel/src/gui/view_text.cpp index 367a3182b..d8552f153 100644 --- a/nel/src/gui/view_text.cpp +++ b/nel/src/gui/view_text.cpp @@ -118,9 +118,10 @@ namespace NLGUI // Letter size // - "_" that should be the character with the lowest part // - A with an accent for the highest part - _FontSizingChars.fromUtf8("_\xc3\x84"); + // https://www.compart.com/en/unicode/U+00C4 + _FontSizingChars = { (u32char)'_', 0x000000C4 }; // fallback if SizingChars are not supported by font - _FontSizingFallback.fromUtf8("|"); + _FontSizingFallback = { (u32char)'|' }; computeFontSize (); } @@ -396,12 +397,12 @@ namespace NLGUI else if ( name == "sizing_chars" ) { - return _FontSizingChars.toUtf8(); + return CUtfStringView(_FontSizingChars).toUtf8(); } else if ( name == "sizing_fallback" ) { - return _FontSizingFallback.toUtf8(); + return CUtfStringView(_FontSizingFallback).toUtf8(); } else return ""; @@ -653,7 +654,7 @@ namespace NLGUI #if 1 if (NLMISC::startsWith(value, "ui")) { - _Text = CI18N::get(value).toUtf8(); + _Text = CI18N::get(value); _TextLength = 0; _HardText = value; } @@ -688,13 +689,13 @@ namespace NLGUI else if( name == "sizing_chars" ) { - _FontSizingChars.fromUtf8(value); + _FontSizingChars = CUtfStringView(value).toUtf32(); return true; } else if( name == "sizing_fallback" ) { - _FontSizingFallback.fromUtf8(value); + _FontSizingFallback = CUtfStringView(value).toUtf32(); return true; } else @@ -766,8 +767,8 @@ namespace NLGUI xmlSetProp( node, BAD_CAST "clamp_right", BAD_CAST toString( _ClampRight ).c_str() ); xmlSetProp( node, BAD_CAST "auto_clamp_offset", BAD_CAST toString( _AutoClampOffset ).c_str() ); xmlSetProp( node, BAD_CAST "continuous_update", BAD_CAST toString( _ContinuousUpdate ).c_str() ); - xmlSetProp( node, BAD_CAST "sizing_chars", BAD_CAST _FontSizingChars.toUtf8().c_str() ); - xmlSetProp( node, BAD_CAST "sizing_fallback", BAD_CAST _FontSizingFallback.toUtf8().c_str() ); + xmlSetProp( node, BAD_CAST "sizing_chars", BAD_CAST CUtfStringView(_FontSizingChars).toUtf8().c_str() ); + xmlSetProp( node, BAD_CAST "sizing_fallback", BAD_CAST CUtfStringView(_FontSizingFallback).toUtf8().c_str() ); return true; } @@ -953,16 +954,16 @@ namespace NLGUI } // "_Ä" lowest/highest chars (underscore, A+diaeresis) - _FontSizingChars.fromUtf8("_\xc3\x84"); + _FontSizingChars = { (u32char)'_', 0x000000C4 }; prop = (char*) xmlGetProp( cur, (xmlChar*)"sizing_chars" ); if (prop) - _FontSizingChars.fromUtf8((const char*)prop); + _FontSizingChars = CUtfStringView((const char*)prop).toUtf32(); // fallback if SizingChars are not supported by font - _FontSizingFallback.fromUtf8("|"); + _FontSizingFallback = { (u32char)'|' }; prop = (char*) xmlGetProp( cur, (xmlChar*)"sizing_fallback" ); if (prop) - _FontSizingFallback.fromUtf8((const char*)prop); + _FontSizingFallback = CUtfStringView((const char*)prop).toUtf32(); computeFontSize (); } @@ -1000,7 +1001,7 @@ namespace NLGUI if (NLMISC::startsWith(propPtr, "ui")) { _HardText = propPtr; - _Text = CI18N::get(propPtr).toUtf8(); + _Text = CI18N::get(propPtr); _TextLength = 0; } else @@ -1021,11 +1022,11 @@ namespace NLGUI if (_MultiLine) { - setTextFormatTaged(CI18N::get(propPtr).toUtf8()); + setTextFormatTaged(CI18N::get(propPtr)); } else { - setSingleLineTextFormatTaged(CI18N::get(propPtr).toUtf8()); + setSingleLineTextFormatTaged(CI18N::get(propPtr)); } } @@ -1468,9 +1469,9 @@ namespace NLGUI void CViewText::setFontSizing(const std::string &chars, const std::string &fallback) { _FontSizingChars.clear(); - _FontSizingChars.fromUtf8(chars); + _FontSizingChars = CUtfStringView(chars).toUtf32(); _FontSizingFallback.clear(); - _FontSizingFallback.fromUtf8(fallback); + _FontSizingFallback = CUtfStringView(fallback).toUtf32(); } // *************************************************************************** @@ -1683,7 +1684,7 @@ namespace NLGUI nMaxWidth *= _Scale; //for (i = 0; i < textSize; ++i) CUtfStringView sv(_Text); - u32string ucStrLetter(1, ' '); + ::u32string ucStrLetter(1, ' '); for (CUtfStringView::iterator it(sv.begin()), end(sv.end()); it != end; ++it, ++i) { if(isFormatTagChange(i, formatTagIndex)) @@ -1863,7 +1864,7 @@ namespace NLGUI uint i; for(i= (uint)spaceEnd;i<(uint)_Text.length();i++) { - ucchar c= _Text[i]; + char c= _Text[i]; if(c==' ' || c=='\n') break; // If change of color tag, stop the word, but don't take the new color now. @@ -1950,7 +1951,7 @@ namespace NLGUI else { float px = numSpaces * _SpaceWidth; - u32string oneChar(1, ' '); + ::u32string oneChar(1, ' '); CUtfStringView wsv(wordValue); CUtfStringView::iterator wit(wsv.begin()), wend(wsv.end()); for (; wit != wend; ++wit) @@ -2198,7 +2199,7 @@ namespace NLGUI if (_ClampRight) { CUtfStringView sv(_Text); - u32string ucStrLetter = u32string(1, (u32char)' '); + ::u32string ucStrLetter = u32string(1, (u32char)' '); for (CUtfStringView::iterator it(sv.begin()), end(sv.end()); it != end; ++it) { ucStrLetter[0] = *it; @@ -2224,8 +2225,8 @@ namespace NLGUI else { // FIXME: Optimize reverse UTF iteration - u32string uctext = CUtfStringView(_Text).toUtf32(); - u32string ucStrLetter = u32string(1, (u32char)' '); + ::u32string uctext = CUtfStringView(_Text).toUtf32(); + ::u32string ucStrLetter = u32string(1, (u32char)' '); for (sint i = (sint)uctext.size() - 1; i >= 0; --i) { ucStrLetter[0] = uctext[i]; @@ -2358,7 +2359,7 @@ namespace NLGUI charIndex += currLine.getNumChars() + currLine.getEndSpaces() + (currLine.getLF() ? 1 : 0); } // skip all spaces at start of line (unless there are only spaces in the line) - std::string::size_type nextPos = _Text.find_first_not_of((ucchar) ' ', charIndex); + std::string::size_type nextPos = _Text.find_first_not_of(' ', charIndex); if (nextPos != std::string::npos) { if (getLineFromIndex(charIndex) == (sint) line) @@ -2394,7 +2395,7 @@ namespace NLGUI { if (NLMISC::startsWith(ht, "ui")) { - setText(CI18N::get(ht).toUtf8()); + setText(CI18N::get(ht)); _HardText = ht; } else @@ -2567,7 +2568,7 @@ namespace NLGUI float px = 0.f; UTextContext::CStringInfo si; - u32string singleChar(1, ' '); + ::u32string singleChar(1, ' '); uint i = 0; NLMISC::CUtfStringView sv(textValue); for (NLMISC::CUtfStringView::iterator it(sv.begin()), end(sv.end()); it != end; ++it, ++i) @@ -3207,7 +3208,7 @@ namespace NLGUI // *************************************************************************** - void CViewText::buildFormatTagText(const std::string &text, std::string &textBuild, std::vector &formatTags, std::vector &tooltips) + void CViewText::buildFormatTagText(const std::string &text, std::string &textBuild, std::vector &formatTags, std::vector &tooltips) { formatTags.clear(); tooltips.clear(); @@ -3243,7 +3244,7 @@ namespace NLGUI // get old tag. CViewText::CFormatTag ct= precTag; // get new Tab and skip tag. - ucstring uitt = getTooltipTag(text, i); + string uitt = getTooltipTag(text, i); if (uitt.empty()) { ct.IndexTt= -1; @@ -3296,7 +3297,7 @@ namespace NLGUI std::string tempText; // static to avoid reallocation static std::vector tempFormatTags; - static std::vector tempTooltips; + static std::vector tempTooltips; buildFormatTagText(text, tempText, tempFormatTags, tempTooltips); setCase (tempText, _CaseMode); @@ -3344,9 +3345,9 @@ namespace NLGUI pTooltip->setId(_Id+"_tt"+toString(i)); pTooltip->setAvoidResizeParent(avoidResizeParent()); pTooltip->setRenderLayer(getRenderLayer()); - std::string tempTooltipStr = tempTooltips[i].toUtf8(); + std::string tempTooltipStr = tempTooltips[i]; bool isI18N = NLMISC::startsWith(tempTooltipStr, "ui"); - pTooltip->setDefaultContextHelp(isI18N ? CI18N::get(tempTooltipStr) : ucstring::makeFromUtf8(tempTooltipStr)); + pTooltip->setDefaultContextHelp(isI18N ? CI18N::get(tempTooltipStr) : tempTooltipStr); pTooltip->setParentPos(this); pTooltip->setParentPosRef(Hotspot_BR); pTooltip->setPosRef(Hotspot_BR); @@ -3390,7 +3391,7 @@ namespace NLGUI // to allow cache (avoid infinite recurse in updateCoords() in some case), compute in temp std::string tempText; static std::vector tempLetterColors; - static std::vector tempTooltips; + static std::vector tempTooltips; // parse text buildFormatTagText(text, tempText, tempLetterColors, tempTooltips); @@ -3405,7 +3406,7 @@ namespace NLGUI while(textIndex2) && (_FormatString[0] == 'u') && (_FormatString[1] == 'i')) - _FormatString = NLMISC::CI18N::get (format.toString()); + if (NLMISC::startsWith(format, "ui")) + _FormatString = NLMISC::CI18N::get(format); + else + _FormatString = format; } // **************************************************************************** - ucstring CViewTextFormated::formatString(const ucstring &inputString, const ucstring ¶mString) + std::string CViewTextFormated::formatString(const std::string &inputString, const std::string ¶mString) { - ucstring formatedResult; + std::string formatedResult; if( textFormatter == NULL ) formatedResult = inputString; diff --git a/nel/src/gui/view_text_id.cpp b/nel/src/gui/view_text_id.cpp index 065d02e71..1f1ac5440 100644 --- a/nel/src/gui/view_text_id.cpp +++ b/nel/src/gui/view_text_id.cpp @@ -204,7 +204,7 @@ namespace NLGUI if (!_Initialized) { // String result - ucstring result; + string result; if( textProvider != NULL ) { @@ -218,8 +218,8 @@ namespace NLGUI // Remove all {break} for(;;) { - ucstring::size_type index = result.find (ucstring("{break}")); - if (index == ucstring::npos) break; + string::size_type index = result.find("{break}"); + if (index == string::npos) break; result = result.substr (0, index) + result.substr(index+7, result.size()); } @@ -229,13 +229,13 @@ namespace NLGUI // Modify the text? if(_StringModifier) - _StringModifier->onReceiveTextId(result); + _StringModifier->onReceiveTextId(ucstring::makeFromUtf8(result)); // Set the Text if(_IsTextFormatTaged) - setTextFormatTaged(result.toUtf8()); + setTextFormatTaged(result); else - setText (result.toUtf8()); + setText(result); } CViewText::checkCoords(); } diff --git a/nel/src/gui/view_text_id_formated.cpp b/nel/src/gui/view_text_id_formated.cpp index 5b1dd2a14..88f9a58e0 100644 --- a/nel/src/gui/view_text_id_formated.cpp +++ b/nel/src/gui/view_text_id_formated.cpp @@ -37,7 +37,7 @@ namespace NLGUI { if (name == "format") { - return getFormatString().toUtf8(); + return getFormatString(); } else return CViewTextID::getProperty(name); @@ -47,7 +47,7 @@ namespace NLGUI { if (name == "format") { - setFormatString(ucstring::makeFromUtf8(value)); + setFormatString(value); return; } else @@ -61,7 +61,7 @@ namespace NLGUI return NULL; xmlSetProp( node, BAD_CAST "type", BAD_CAST "text_id_formated" ); - xmlSetProp( node, BAD_CAST "format", BAD_CAST getFormatString().toUtf8().c_str() ); + xmlSetProp( node, BAD_CAST "format", BAD_CAST getFormatString().c_str() ); return node; } @@ -72,9 +72,9 @@ namespace NLGUI if (!CViewTextID::parse(cur, parentGroup)) return false; CXMLAutoPtr prop((const char*) xmlGetProp( cur, (xmlChar*)"format" )); if (prop) - setFormatString(ucstring::makeFromUtf8((const char *)prop)); + setFormatString((const char *)prop); else - setFormatString(ucstring("$t")); + setFormatString("$t"); return true; } @@ -89,15 +89,15 @@ namespace NLGUI if (!_Initialized) { - ucstring result, formatedResult; + std::string result, formatedResult; bool bValid; if( CViewTextID::getTextProvider() == NULL ) { if(!_DBPath.empty()) - result = ucstring(_DBPath); + result = _DBPath; else - result = ucstring("Text ID = " + NLMISC::toString(_TextId)); + result = "Text ID = " + NLMISC::toString(_TextId); bValid = true; } else @@ -106,7 +106,7 @@ namespace NLGUI } formatedResult = CViewTextFormated::formatString(_FormatString, result); // - setText (formatedResult.toUtf8()); + setText (formatedResult); // if (bValid) { @@ -117,12 +117,13 @@ namespace NLGUI } // **************************************************************************** - void CViewTextIDFormated::setFormatString(const ucstring &format) + void CViewTextIDFormated::setFormatString(const std::string &format) { _Initialized = false; - _FormatString = format; - if ( (_FormatString.size()>2) && (_FormatString[0] == 'u') && (_FormatString[1] == 'i')) - _FormatString = NLMISC::CI18N::get (format.toString()); + if (NLMISC::startsWith(format, "ui")) + _FormatString = NLMISC::CI18N::get(format); + else + _FormatString = format; } } diff --git a/nel/src/gui/widget_manager.cpp b/nel/src/gui/widget_manager.cpp index 4d783df7d..135249ce9 100644 --- a/nel/src/gui/widget_manager.cpp +++ b/nel/src/gui/widget_manager.cpp @@ -1531,7 +1531,7 @@ namespace NLGUI CViewText *pTxt = (CViewText*)groupContextHelp->getView("text"); if (pTxt != NULL) { - pTxt->setTextFormatTaged(_ContextHelpText.toUtf8()); + pTxt->setTextFormatTaged(_ContextHelpText); // update only to get correct W/H groupContextHelp->updateCoords (); diff --git a/nel/src/misc/common.cpp b/nel/src/misc/common.cpp index b9e9a7d85..cbc6ee070 100644 --- a/nel/src/misc/common.cpp +++ b/nel/src/misc/common.cpp @@ -594,6 +594,8 @@ NLMISC_CATEGORISED_COMMAND(nel,stohr, "Convert a second number into an human rea return true; } +#if 0 + std::string toLower(const char *str) { if (!str) return ""; @@ -625,6 +627,8 @@ std::string toLower(const std::string &str) return res; } +#endif + char toLower(const char ch) { if( (ch >= 'A') && (ch <= 'Z') ) @@ -652,6 +656,8 @@ void toLower(char *str) } } +#if 0 + std::string toUpper(const std::string &str) { string res; @@ -666,6 +672,8 @@ std::string toUpper(const std::string &str) return res; } +#endif + void toUpper(char *str) { if (str == 0) @@ -876,7 +884,7 @@ std::string formatThousands(const std::string& s) { sint i, k; sint remaining = (sint)s.length() - 1; - static std::string separator = NLMISC::CI18N::get("uiThousandsSeparator").toUtf8(); + static std::string separator = NLMISC::CI18N::get("uiThousandsSeparator"); // Don't add separator if the number is < 10k if (remaining < 4) return s; diff --git a/nel/src/misc/i18n.cpp b/nel/src/misc/i18n.cpp index 27a47c2e4..729234f56 100644 --- a/nel/src/misc/i18n.cpp +++ b/nel/src/misc/i18n.cpp @@ -38,15 +38,18 @@ using namespace std; namespace NLMISC { -CI18N::StrMapContainer CI18N::_StrMap; -CI18N::StrMapContainer CI18N::_StrMapFallback; -bool CI18N::_StrMapLoaded = false; -const ucstring CI18N::_NotTranslatedValue(""); +CI18N::StrMapContainer CI18N::_StrMap; +CI18N::StrMapContainer CI18N::_StrMapFallback; +CI18N::StrMapContainer16 CI18N::_StrMap16; +CI18N::StrMapContainer16 CI18N::_StrMapFallback16; +bool CI18N::_StrMapLoaded = false; +const ucstring CI18N::_NotTranslatedValue16(""); +const std::string CI18N::_NotTranslatedValue(""); bool CI18N::_LanguagesNamesLoaded = false; string CI18N::_SelectedLanguageCode; CI18N::ILoadProxy *CI18N::_LoadProxy = 0; vector CI18N::_LanguageCodes; -vector CI18N::_LanguageNames; +vector CI18N::_LanguageNames; std::string CI18N::_SystemLanguageCode; bool CI18N::noResolution = false; @@ -65,17 +68,17 @@ void CI18N::initLanguages() _LanguageCodes.push_back("ru"); _LanguageCodes.push_back("es"); - _LanguageNames.push_back(ucstring("English")); - _LanguageNames.push_back(ucstring("French")); - _LanguageNames.push_back(ucstring("German")); - _LanguageNames.push_back(ucstring("Russian")); - _LanguageNames.push_back(ucstring("Spanish")); + _LanguageNames.push_back("English"); + _LanguageNames.push_back("French"); + _LanguageNames.push_back("German"); + _LanguageNames.push_back("Russian"); + _LanguageNames.push_back("Spanish"); _LanguagesNamesLoaded = true; } } -const std::vector &CI18N::getLanguageNames() +const std::vector &CI18N::getLanguageNames() { initLanguages(); @@ -91,19 +94,27 @@ const std::vector &CI18N::getLanguageCodes() void CI18N::load (const string &languageCode, const string &fallbackLanguageCode) { - if (_StrMapLoaded) _StrMap.clear (); - else _StrMapLoaded = true; + if (_StrMapLoaded) + { + _StrMap.clear(); + _StrMap16.clear(); + } + else + { + _StrMapLoaded = true; + } _SelectedLanguageCode = languageCode; - loadFileIntoMap(languageCode + ".uxt", _StrMap); + loadFileIntoMap(languageCode + ".uxt", _StrMap, _StrMap16); _StrMapFallback.clear(); + _StrMapFallback16.clear(); if(!fallbackLanguageCode.empty()) { - loadFileIntoMap(fallbackLanguageCode + ".uxt", _StrMapFallback); + loadFileIntoMap(fallbackLanguageCode + ".uxt", _StrMapFallback, _StrMapFallback16); } } -bool CI18N::loadFileIntoMap(const string &fileName, StrMapContainer &destMap) +bool CI18N::loadFileIntoMap(const string &fileName, StrMapContainer &destMap, StrMapContainer16 &destMap16) { ucstring text; // read in the text @@ -138,11 +149,12 @@ bool CI18N::loadFileIntoMap(const string &fileName, StrMapContainer &destMap) // ok, a line read. pair::iterator, bool> ret; - ret = destMap.insert(make_pair(label, ucs)); + ret = destMap16.insert(make_pair(label, ucs)); if (!ret.second) { nlwarning("I18N: Error in %s, the label %s exists twice !", fileName.c_str(), label.c_str()); } + destMap.insert(make_pair(label, ucs.toUtf8())); skipWhiteSpace(first, last); } @@ -152,13 +164,15 @@ bool CI18N::loadFileIntoMap(const string &fileName, StrMapContainer &destMap) { nlwarning("I18N: In file %s, missing LanguageName translation (should be first in file)", fileName.c_str()); } + nlassert(destMap.size() == destMap16.size()); return true; } void CI18N::loadFromFilename(const string &filename, bool reload) { StrMapContainer destMap; - if (!loadFileIntoMap(filename, destMap)) + StrMapContainer16 destMap16; + if (!loadFileIntoMap(filename, destMap, destMap16)) { return; } @@ -167,16 +181,52 @@ void CI18N::loadFromFilename(const string &filename, bool reload) { if (!reload) { - if (_StrMap.count(it->first)) + if (_StrMap16.count(it->first)) { nlwarning("I18N: Error in %s, the label %s exist twice !", filename.c_str(), it->first.c_str()); } } + _StrMap16[it->first] = ucstring::makeFromUtf8(it->second); _StrMap[it->first] = it->second; } } -const ucstring &CI18N::get (const string &label) +const std::string &CI18N::get(const string &label) +{ + if (noResolution) + { + return label; + } + + if (label.empty()) + { + static const std::string empty; + return empty; + } + + StrMapContainer::iterator it(_StrMap.find(label)); + + if (it != _StrMap.end()) + return it->second; + + static CHashSet missingStrings; + if (missingStrings.find(label) == missingStrings.end()) + { + nlwarning("I18N: The string %s did not exist in language %s (display once)", label.c_str(), _SelectedLanguageCode.c_str()); + missingStrings.insert(label); + } + + // use the fall back language if it exists + it = _StrMapFallback.find(label); + if (it != _StrMapFallback.end()) + return it->second; + + static std::string badString; + badString = string(""; + return badString; +} + +const ucstring &CI18N::getAsUtf16 (const string &label) { if( noResolution ) { @@ -187,13 +237,13 @@ const ucstring &CI18N::get (const string &label) if (label.empty()) { - static ucstring emptyString; + static const ucstring emptyString; return emptyString; } - StrMapContainer::iterator it(_StrMap.find(label)); + StrMapContainer16::iterator it(_StrMap16.find(label)); - if (it != _StrMap.end()) + if (it != _StrMap16.end()) return it->second; static CHashSet missingStrings; @@ -204,8 +254,8 @@ const ucstring &CI18N::get (const string &label) } // use the fall back language if it exists - it = _StrMapFallback.find(label); - if (it != _StrMapFallback.end()) + it = _StrMapFallback16.find(label); + if (it != _StrMapFallback16.end()) return it->second; static ucstring badString; @@ -229,7 +279,7 @@ bool CI18N::hasTranslation(const string &label) return false; } -ucstring CI18N::getCurrentLanguageName () +std::string CI18N::getCurrentLanguageName () { return get("LanguageName"); } @@ -379,7 +429,7 @@ std::string CI18N::getSystemLanguageCode () // locales names are different under Windows, for example: French_France.1252 for(uint i = 0; i < _LanguageNames.size(); ++i) { - std::string name = _LanguageNames[i].toUtf8(); + std::string name = _LanguageNames[i]; // so we compare the language name with the supported ones if (lang.compare(0, name.length(), name) == 0) @@ -439,7 +489,7 @@ bool CI18N::setSystemLanguageCode (const std::string &languageCode) // check if language name is supported for(uint i = 0; i < _LanguageNames.size(); ++i) { - std::string name = NLMISC::toLower(_LanguageNames[i].toUtf8()); + std::string name = NLMISC::toLower(_LanguageNames[i]); if (name == lang) { diff --git a/nel/src/misc/inter_window_msg_queue.cpp b/nel/src/misc/inter_window_msg_queue.cpp index f27fa55da..ead2565a4 100644 --- a/nel/src/misc/inter_window_msg_queue.cpp +++ b/nel/src/misc/inter_window_msg_queue.cpp @@ -459,6 +459,9 @@ namespace NLMISC { return handleWMCopyData(hwnd, (COPYDATASTRUCT *) lParam); } + // https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-unichar + if (uMsg == WM_UNICHAR) + return (wParam == UNICODE_NOCHAR); return DefWindowProc(hwnd, uMsg, wParam, lParam); } diff --git a/nel/src/misc/unicode.cpp b/nel/src/misc/unicode.cpp index 6a0bf25c0..c6780db54 100644 --- a/nel/src/misc/unicode.cpp +++ b/nel/src/misc/unicode.cpp @@ -25,6 +25,9 @@ namespace NLMISC { +// TODO / FIXME: Write tool to regenerate the unicode tables in this file +// See: ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt + // Uppercase to lowercase 16 bits unicode. This table must be sorted. First entry must be unique. static const ucchar UnicodeUpperToLower[]= { @@ -1233,7 +1236,7 @@ static const ucchar UnicodeLowerToUpper[]= 0x03B6, 0x0396, // GREEK CAPITAL LETTER ZETA 0x03B7, 0x0397, // GREEK CAPITAL LETTER ETA 0x03B8, 0x0398, // GREEK CAPITAL LETTER THETA - 0x03B9, 0x0345, // COMBINING GREEK YPOGEGRAMMENI + 0x03B9, 0x0399, // GREEK CAPITAL LETTER IOTA 0x03BA, 0x039A, // GREEK CAPITAL LETTER KAPPA 0x03BB, 0x039B, // GREEK CAPITAL LETTER LAMDA 0x03BC, 0x039C, // GREEK CAPITAL LETTER MU @@ -1950,39 +1953,6 @@ ucchar toLower (ucchar c) // *************************************************************************** -static std::string toLowerAsUtf8(CUtfStringView sv) -{ - std::string res; - res.reserve(sv.largestSize()); - for (CUtfStringView::iterator it(sv.begin()), end(sv.end()); it != end; ++it) - { - u32char c = *it; - if (c < 0x10000) - { - ucchar uc = c; - ucchar *result = toLowerUpperSearch(&uc, UnicodeUpperToLower); - if (result) - c = result[1]; - } - CUtfStringView::append(res, c); - } - return res; -} - -std::string toLowerAsUtf8(const char *str) -{ - return toLowerAsUtf8(CUtfStringView(str)); -} - -// *************************************************************************** - -std::string toLowerAsUtf8(const std::string &str) -{ - return toLowerAsUtf8(CUtfStringView(str)); -} - -// *************************************************************************** - ucstring toUpper (const ucstring &str) { uint i; @@ -2023,6 +1993,2928 @@ ucchar toUpper (ucchar c) return c; } +// *************************************************************************** +// *************************************************************************** +// *************************************************************************** + +static const char s_Utf8UpperToLowerC2[64 * 4] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xCE', '\xBC', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8UpperToLowerC3[64 * 4] = { + '\xC3', '\xA0', '\x00', 0, + '\xC3', '\xA1', '\x00', 0, + '\xC3', '\xA2', '\x00', 0, + '\xC3', '\xA3', '\x00', 0, + '\xC3', '\xA4', '\x00', 0, + '\xC3', '\xA5', '\x00', 0, + '\xC3', '\xA6', '\x00', 0, + '\xC3', '\xA7', '\x00', 0, + '\xC3', '\xA8', '\x00', 0, + '\xC3', '\xA9', '\x00', 0, + '\xC3', '\xAA', '\x00', 0, + '\xC3', '\xAB', '\x00', 0, + '\xC3', '\xAC', '\x00', 0, + '\xC3', '\xAD', '\x00', 0, + '\xC3', '\xAE', '\x00', 0, + '\xC3', '\xAF', '\x00', 0, + '\xC3', '\xB0', '\x00', 0, + '\xC3', '\xB1', '\x00', 0, + '\xC3', '\xB2', '\x00', 0, + '\xC3', '\xB3', '\x00', 0, + '\xC3', '\xB4', '\x00', 0, + '\xC3', '\xB5', '\x00', 0, + '\xC3', '\xB6', '\x00', 0, + 0, 0, 0, 0, + '\xC3', '\xB8', '\x00', 0, + '\xC3', '\xB9', '\x00', 0, + '\xC3', '\xBA', '\x00', 0, + '\xC3', '\xBB', '\x00', 0, + '\xC3', '\xBC', '\x00', 0, + '\xC3', '\xBD', '\x00', 0, + '\xC3', '\xBE', '\x00', 0, + '\xC3', '\x9F', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8UpperToLowerC4[64 * 4] = { + '\xC4', '\x81', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\x83', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\x85', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\x87', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\x89', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\x8B', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\x8D', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\x8F', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\x91', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\x93', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\x95', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\x97', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\x99', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\x9B', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\x9D', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\x9F', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\xA1', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\xA3', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\xA5', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\xA7', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\xA9', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\xAB', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\xAD', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\xAF', '\x00', 0, + 0, 0, 0, 0, + '\x69', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\xB3', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\xB5', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\xB7', '\x00', 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + '\xC4', '\xBA', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\xBC', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\xBE', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\x80', '\x00', 0, +}; + +static const char s_Utf8UpperToLowerC5[64 * 4] = { + 0, 0, 0, 0, + '\xC5', '\x82', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\x84', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\x86', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\x88', '\x00', 0, + 0, 0, 0, 0, + '\xCA', '\xBC', '\x00', 0, + '\xC5', '\x8B', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\x8D', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\x8F', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\x91', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\x93', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\x95', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\x97', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\x99', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\x9B', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\x9D', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\x9F', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\xA1', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\xA3', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\xA5', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\xA7', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\xA9', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\xAB', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\xAD', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\xAF', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\xB1', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\xB3', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\xB5', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\xB7', '\x00', 0, + 0, 0, 0, 0, + '\xC3', '\xBF', '\x00', 0, + '\xC5', '\xBA', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\xBC', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\xBE', '\x00', 0, + 0, 0, 0, 0, + '\x73', '\x00', '\x00', 0, +}; + +static const char s_Utf8UpperToLowerC6[64 * 4] = { + 0, 0, 0, 0, + '\xC9', '\x93', '\x00', 0, + '\xC6', '\x83', '\x00', 0, + 0, 0, 0, 0, + '\xC6', '\x85', '\x00', 0, + 0, 0, 0, 0, + '\xC9', '\x94', '\x00', 0, + '\xC6', '\x88', '\x00', 0, + 0, 0, 0, 0, + '\xC9', '\x96', '\x00', 0, + '\xC9', '\x97', '\x00', 0, + '\xC6', '\x8C', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\xC7', '\x9D', '\x00', 0, + '\xC9', '\x99', '\x00', 0, + '\xC9', '\x9B', '\x00', 0, + '\xC6', '\x92', '\x00', 0, + 0, 0, 0, 0, + '\xC9', '\xA0', '\x00', 0, + '\xC9', '\xA3', '\x00', 0, + 0, 0, 0, 0, + '\xC9', '\xA9', '\x00', 0, + '\xC9', '\xA8', '\x00', 0, + '\xC6', '\x99', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xC9', '\xAF', '\x00', 0, + '\xC9', '\xB2', '\x00', 0, + 0, 0, 0, 0, + '\xC9', '\xB5', '\x00', 0, + '\xC6', '\xA1', '\x00', 0, + 0, 0, 0, 0, + '\xC6', '\xA3', '\x00', 0, + 0, 0, 0, 0, + '\xC6', '\xA5', '\x00', 0, + 0, 0, 0, 0, + '\xCA', '\x80', '\x00', 0, + '\xC6', '\xA8', '\x00', 0, + 0, 0, 0, 0, + '\xCA', '\x83', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\xC6', '\xAD', '\x00', 0, + 0, 0, 0, 0, + '\xCA', '\x88', '\x00', 0, + '\xC6', '\xB0', '\x00', 0, + 0, 0, 0, 0, + '\xCA', '\x8A', '\x00', 0, + '\xCA', '\x8B', '\x00', 0, + '\xC6', '\xB4', '\x00', 0, + 0, 0, 0, 0, + '\xC6', '\xB6', '\x00', 0, + 0, 0, 0, 0, + '\xCA', '\x92', '\x00', 0, + '\xC6', '\xB9', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xC6', '\xBD', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8UpperToLowerC7[64 * 4] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xC7', '\x86', '\x00', 0, + '\xC7', '\x86', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\x89', '\x00', 0, + '\xC7', '\x89', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\x8C', '\x00', 0, + '\xC7', '\x8C', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\x8E', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\x90', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\x92', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\x94', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\x96', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\x98', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\x9A', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\x9C', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\xC7', '\x9F', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\xA1', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\xA3', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\xA5', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\xA7', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\xA9', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\xAB', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\xAD', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\xAF', '\x00', 0, + 0, 0, 0, 0, + '\x6A', '\x00', '\x00', 0, + '\xC7', '\xB3', '\x00', 0, + '\xC7', '\xB3', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\xB5', '\x00', 0, + 0, 0, 0, 0, + '\xC6', '\x95', '\x00', 0, + '\xC6', '\xBF', '\x00', 0, + '\xC7', '\xB9', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\xBB', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\xBD', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\xBF', '\x00', 0, + 0, 0, 0, 0, +}; + +static const char s_Utf8UpperToLowerC8[64 * 4] = { + '\xC8', '\x81', '\x00', 0, + 0, 0, 0, 0, + '\xC8', '\x83', '\x00', 0, + 0, 0, 0, 0, + '\xC8', '\x85', '\x00', 0, + 0, 0, 0, 0, + '\xC8', '\x87', '\x00', 0, + 0, 0, 0, 0, + '\xC8', '\x89', '\x00', 0, + 0, 0, 0, 0, + '\xC8', '\x8B', '\x00', 0, + 0, 0, 0, 0, + '\xC8', '\x8D', '\x00', 0, + 0, 0, 0, 0, + '\xC8', '\x8F', '\x00', 0, + 0, 0, 0, 0, + '\xC8', '\x91', '\x00', 0, + 0, 0, 0, 0, + '\xC8', '\x93', '\x00', 0, + 0, 0, 0, 0, + '\xC8', '\x95', '\x00', 0, + 0, 0, 0, 0, + '\xC8', '\x97', '\x00', 0, + 0, 0, 0, 0, + '\xC8', '\x99', '\x00', 0, + 0, 0, 0, 0, + '\xC8', '\x9B', '\x00', 0, + 0, 0, 0, 0, + '\xC8', '\x9D', '\x00', 0, + 0, 0, 0, 0, + '\xC8', '\x9F', '\x00', 0, + 0, 0, 0, 0, + '\xC6', '\x9E', '\x00', 0, + 0, 0, 0, 0, + '\xC8', '\xA3', '\x00', 0, + 0, 0, 0, 0, + '\xC8', '\xA5', '\x00', 0, + 0, 0, 0, 0, + '\xC8', '\xA7', '\x00', 0, + 0, 0, 0, 0, + '\xC8', '\xA9', '\x00', 0, + 0, 0, 0, 0, + '\xC8', '\xAB', '\x00', 0, + 0, 0, 0, 0, + '\xC8', '\xAD', '\x00', 0, + 0, 0, 0, 0, + '\xC8', '\xAF', '\x00', 0, + 0, 0, 0, 0, + '\xC8', '\xB1', '\x00', 0, + 0, 0, 0, 0, + '\xC8', '\xB3', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8UpperToLowerCD[64 * 4] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xCE', '\xB9', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8UpperToLowerCE[64 * 4] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xCE', '\xAC', '\x00', 0, + 0, 0, 0, 0, + '\xCE', '\xAD', '\x00', 0, + '\xCE', '\xAE', '\x00', 0, + '\xCE', '\xAF', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\x8C', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\x8D', '\x00', 0, + '\xCF', '\x8E', '\x00', 0, + '\xCE', '\xB9', '\x00', 0, + '\xCE', '\xB1', '\x00', 0, + '\xCE', '\xB2', '\x00', 0, + '\xCE', '\xB3', '\x00', 0, + '\xCE', '\xB4', '\x00', 0, + '\xCE', '\xB5', '\x00', 0, + '\xCE', '\xB6', '\x00', 0, + '\xCE', '\xB7', '\x00', 0, + '\xCE', '\xB8', '\x00', 0, + '\xCE', '\xB9', '\x00', 0, + '\xCE', '\xBA', '\x00', 0, + '\xCE', '\xBB', '\x00', 0, + '\xCE', '\xBC', '\x00', 0, + '\xCE', '\xBD', '\x00', 0, + '\xCE', '\xBE', '\x00', 0, + '\xCE', '\xBF', '\x00', 0, + '\xCF', '\x80', '\x00', 0, + '\xCF', '\x81', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\x83', '\x00', 0, + '\xCF', '\x84', '\x00', 0, + '\xCF', '\x85', '\x00', 0, + '\xCF', '\x86', '\x00', 0, + '\xCF', '\x87', '\x00', 0, + '\xCF', '\x88', '\x00', 0, + '\xCF', '\x89', '\x00', 0, + '\xCF', '\x8A', '\x00', 0, + '\xCF', '\x8B', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xCF', '\x85', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8UpperToLowerCF[64 * 4] = { + 0, 0, 0, 0, 0, 0, 0, 0, + '\xCF', '\x83', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xCE', '\xB2', '\x00', 0, + '\xCE', '\xB8', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xCF', '\x86', '\x00', 0, + '\xCF', '\x80', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\x99', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\x9B', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\x9D', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\x9F', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\xA1', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\xA3', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\xA5', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\xA7', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\xA9', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\xAB', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\xAD', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\xAF', '\x00', 0, + 0, 0, 0, 0, + '\xCE', '\xBA', '\x00', 0, + '\xCF', '\x81', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\xCE', '\xB8', '\x00', 0, + '\xCE', '\xB5', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\xB8', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\xB2', '\x00', 0, + '\xCF', '\xBB', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8UpperToLowerD0[64 * 4] = { + '\xD1', '\x90', '\x00', 0, + '\xD1', '\x91', '\x00', 0, + '\xD1', '\x92', '\x00', 0, + '\xD1', '\x93', '\x00', 0, + '\xD1', '\x94', '\x00', 0, + '\xD1', '\x95', '\x00', 0, + '\xD1', '\x96', '\x00', 0, + '\xD1', '\x97', '\x00', 0, + '\xD1', '\x98', '\x00', 0, + '\xD1', '\x99', '\x00', 0, + '\xD1', '\x9A', '\x00', 0, + '\xD1', '\x9B', '\x00', 0, + '\xD1', '\x9C', '\x00', 0, + '\xD1', '\x9D', '\x00', 0, + '\xD1', '\x9E', '\x00', 0, + '\xD1', '\x9F', '\x00', 0, + '\xD0', '\xB0', '\x00', 0, + '\xD0', '\xB1', '\x00', 0, + '\xD0', '\xB2', '\x00', 0, + '\xD0', '\xB3', '\x00', 0, + '\xD0', '\xB4', '\x00', 0, + '\xD0', '\xB5', '\x00', 0, + '\xD0', '\xB6', '\x00', 0, + '\xD0', '\xB7', '\x00', 0, + '\xD0', '\xB8', '\x00', 0, + '\xD0', '\xB9', '\x00', 0, + '\xD0', '\xBA', '\x00', 0, + '\xD0', '\xBB', '\x00', 0, + '\xD0', '\xBC', '\x00', 0, + '\xD0', '\xBD', '\x00', 0, + '\xD0', '\xBE', '\x00', 0, + '\xD0', '\xBF', '\x00', 0, + '\xD1', '\x80', '\x00', 0, + '\xD1', '\x81', '\x00', 0, + '\xD1', '\x82', '\x00', 0, + '\xD1', '\x83', '\x00', 0, + '\xD1', '\x84', '\x00', 0, + '\xD1', '\x85', '\x00', 0, + '\xD1', '\x86', '\x00', 0, + '\xD1', '\x87', '\x00', 0, + '\xD1', '\x88', '\x00', 0, + '\xD1', '\x89', '\x00', 0, + '\xD1', '\x8A', '\x00', 0, + '\xD1', '\x8B', '\x00', 0, + '\xD1', '\x8C', '\x00', 0, + '\xD1', '\x8D', '\x00', 0, + '\xD1', '\x8E', '\x00', 0, + '\xD1', '\x8F', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8UpperToLowerD1[64 * 4] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xD1', '\xA1', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xA3', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xA5', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xA7', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xA9', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xAB', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xAD', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xAF', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xB1', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xB3', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xB5', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xB7', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xB9', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xBB', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xBD', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xBF', '\x00', 0, + 0, 0, 0, 0, +}; + +static const char s_Utf8UpperToLowerD2[64 * 4] = { + '\xD2', '\x81', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\xD2', '\x8B', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\x8D', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\x8F', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\x91', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\x93', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\x95', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\x97', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\x99', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\x9B', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\x9D', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\x9F', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xA1', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xA3', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xA5', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xA7', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xA9', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xAB', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xAD', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xAF', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xB1', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xB3', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xB5', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xB7', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xB9', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xBB', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xBD', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xBF', '\x00', 0, + 0, 0, 0, 0, +}; + +static const char s_Utf8UpperToLowerD3[64 * 4] = { + 0, 0, 0, 0, + '\xD3', '\x82', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x84', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x86', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x88', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x8A', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x8C', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x8E', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\xD3', '\x91', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x93', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x95', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x97', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x99', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x9B', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x9D', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x9F', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\xA1', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\xA3', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\xA5', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\xA7', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\xA9', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\xAB', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\xAD', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\xAF', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\xB1', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\xB3', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\xB5', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xD3', '\xB9', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8UpperToLowerD4[64 * 4] = { + '\xD4', '\x81', '\x00', 0, + 0, 0, 0, 0, + '\xD4', '\x83', '\x00', 0, + 0, 0, 0, 0, + '\xD4', '\x85', '\x00', 0, + 0, 0, 0, 0, + '\xD4', '\x87', '\x00', 0, + 0, 0, 0, 0, + '\xD4', '\x89', '\x00', 0, + 0, 0, 0, 0, + '\xD4', '\x8B', '\x00', 0, + 0, 0, 0, 0, + '\xD4', '\x8D', '\x00', 0, + 0, 0, 0, 0, + '\xD4', '\x8F', '\x00', 0, + 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, + '\xD5', '\xA1', '\x00', 0, + '\xD5', '\xA2', '\x00', 0, + '\xD5', '\xA3', '\x00', 0, + '\xD5', '\xA4', '\x00', 0, + '\xD5', '\xA5', '\x00', 0, + '\xD5', '\xA6', '\x00', 0, + '\xD5', '\xA7', '\x00', 0, + '\xD5', '\xA8', '\x00', 0, + '\xD5', '\xA9', '\x00', 0, + '\xD5', '\xAA', '\x00', 0, + '\xD5', '\xAB', '\x00', 0, + '\xD5', '\xAC', '\x00', 0, + '\xD5', '\xAD', '\x00', 0, + '\xD5', '\xAE', '\x00', 0, + '\xD5', '\xAF', '\x00', 0, +}; + +static const char s_Utf8UpperToLowerD5[64 * 4] = { + '\xD5', '\xB0', '\x00', 0, + '\xD5', '\xB1', '\x00', 0, + '\xD5', '\xB2', '\x00', 0, + '\xD5', '\xB3', '\x00', 0, + '\xD5', '\xB4', '\x00', 0, + '\xD5', '\xB5', '\x00', 0, + '\xD5', '\xB6', '\x00', 0, + '\xD5', '\xB7', '\x00', 0, + '\xD5', '\xB8', '\x00', 0, + '\xD5', '\xB9', '\x00', 0, + '\xD5', '\xBA', '\x00', 0, + '\xD5', '\xBB', '\x00', 0, + '\xD5', '\xBC', '\x00', 0, + '\xD5', '\xBD', '\x00', 0, + '\xD5', '\xBE', '\x00', 0, + '\xD5', '\xBF', '\x00', 0, + '\xD6', '\x80', '\x00', 0, + '\xD6', '\x81', '\x00', 0, + '\xD6', '\x82', '\x00', 0, + '\xD6', '\x83', '\x00', 0, + '\xD6', '\x84', '\x00', 0, + '\xD6', '\x85', '\x00', 0, + '\xD6', '\x86', '\x00', 0, + 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8UpperToLowerD6[64 * 4] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xD5', '\xA5', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8UpperToLowerE1B8[64 * 4] = { + '\xE1', '\xB8', '\x81', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\x83', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\x85', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\x87', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\x89', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\x8B', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\x8D', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\x8F', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\x91', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\x93', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\x95', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\x97', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\x99', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\x9B', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\x9D', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\x9F', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\xA1', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\xA3', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\xA5', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\xA7', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\xA9', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\xAB', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\xAD', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\xAF', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\xB1', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\xB3', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\xB5', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\xB7', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\xB9', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\xBB', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\xBD', 0, + 0, 0, 0, 0, + '\xE1', '\xB8', '\xBF', 0, + 0, 0, 0, 0, +}; + +static const char s_Utf8UpperToLowerE1B9[64 * 4] = { + '\xE1', '\xB9', '\x81', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\x83', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\x85', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\x87', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\x89', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\x8B', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\x8D', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\x8F', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\x91', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\x93', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\x95', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\x97', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\x99', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\x9B', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\x9D', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\x9F', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\xA1', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\xA3', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\xA5', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\xA7', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\xA9', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\xAB', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\xAD', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\xAF', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\xB1', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\xB3', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\xB5', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\xB7', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\xB9', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\xBB', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\xBD', 0, + 0, 0, 0, 0, + '\xE1', '\xB9', '\xBF', 0, + 0, 0, 0, 0, +}; + +static const char s_Utf8UpperToLowerE1BA[64 * 4] = { + '\xE1', '\xBA', '\x81', 0, + 0, 0, 0, 0, + '\xE1', '\xBA', '\x83', 0, + 0, 0, 0, 0, + '\xE1', '\xBA', '\x85', 0, + 0, 0, 0, 0, + '\xE1', '\xBA', '\x87', 0, + 0, 0, 0, 0, + '\xE1', '\xBA', '\x89', 0, + 0, 0, 0, 0, + '\xE1', '\xBA', '\x8B', 0, + 0, 0, 0, 0, + '\xE1', '\xBA', '\x8D', 0, + 0, 0, 0, 0, + '\xE1', '\xBA', '\x8F', 0, + 0, 0, 0, 0, + '\xE1', '\xBA', '\x91', 0, + 0, 0, 0, 0, + '\xE1', '\xBA', '\x93', 0, + 0, 0, 0, 0, + '\xE1', '\xBA', '\x95', 0, + 0, 0, 0, 0, + '\x68', '\x00', '\x00', 0, + '\x74', '\x00', '\x00', 0, + '\x77', '\x00', '\x00', 0, + '\x79', '\x00', '\x00', 0, + '\x61', '\x00', '\x00', 0, + '\xE1', '\xB9', '\xA1', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xE1', '\xBA', '\xA1', 0, + 0, 0, 0, 0, + '\xE1', '\xBA', '\xA3', 0, + 0, 0, 0, 0, + '\xE1', '\xBA', '\xA5', 0, + 0, 0, 0, 0, + '\xE1', '\xBA', '\xA7', 0, + 0, 0, 0, 0, + '\xE1', '\xBA', '\xA9', 0, + 0, 0, 0, 0, + '\xE1', '\xBA', '\xAB', 0, + 0, 0, 0, 0, + '\xE1', '\xBA', '\xAD', 0, + 0, 0, 0, 0, + '\xE1', '\xBA', '\xAF', 0, + 0, 0, 0, 0, + '\xE1', '\xBA', '\xB1', 0, + 0, 0, 0, 0, + '\xE1', '\xBA', '\xB3', 0, + 0, 0, 0, 0, + '\xE1', '\xBA', '\xB5', 0, + 0, 0, 0, 0, + '\xE1', '\xBA', '\xB7', 0, + 0, 0, 0, 0, + '\xE1', '\xBA', '\xB9', 0, + 0, 0, 0, 0, + '\xE1', '\xBA', '\xBB', 0, + 0, 0, 0, 0, + '\xE1', '\xBA', '\xBD', 0, + 0, 0, 0, 0, + '\xE1', '\xBA', '\xBF', 0, + 0, 0, 0, 0, +}; + +static const char s_Utf8UpperToLowerE1BB[64 * 4] = { + '\xE1', '\xBB', '\x81', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\x83', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\x85', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\x87', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\x89', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\x8B', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\x8D', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\x8F', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\x91', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\x93', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\x95', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\x97', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\x99', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\x9B', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\x9D', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\x9F', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\xA1', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\xA3', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\xA5', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\xA7', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\xA9', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\xAB', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\xAD', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\xAF', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\xB1', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\xB3', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\xB5', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\xB7', 0, + 0, 0, 0, 0, + '\xE1', '\xBB', '\xB9', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8UpperToLowerE1BC[64 * 4] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xE1', '\xBC', '\x80', 0, + '\xE1', '\xBC', '\x81', 0, + '\xE1', '\xBC', '\x82', 0, + '\xE1', '\xBC', '\x83', 0, + '\xE1', '\xBC', '\x84', 0, + '\xE1', '\xBC', '\x85', 0, + '\xE1', '\xBC', '\x86', 0, + '\xE1', '\xBC', '\x87', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xE1', '\xBC', '\x90', 0, + '\xE1', '\xBC', '\x91', 0, + '\xE1', '\xBC', '\x92', 0, + '\xE1', '\xBC', '\x93', 0, + '\xE1', '\xBC', '\x94', 0, + '\xE1', '\xBC', '\x95', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xE1', '\xBC', '\xA0', 0, + '\xE1', '\xBC', '\xA1', 0, + '\xE1', '\xBC', '\xA2', 0, + '\xE1', '\xBC', '\xA3', 0, + '\xE1', '\xBC', '\xA4', 0, + '\xE1', '\xBC', '\xA5', 0, + '\xE1', '\xBC', '\xA6', 0, + '\xE1', '\xBC', '\xA7', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xE1', '\xBC', '\xB0', 0, + '\xE1', '\xBC', '\xB1', 0, + '\xE1', '\xBC', '\xB2', 0, + '\xE1', '\xBC', '\xB3', 0, + '\xE1', '\xBC', '\xB4', 0, + '\xE1', '\xBC', '\xB5', 0, + '\xE1', '\xBC', '\xB6', 0, + '\xE1', '\xBC', '\xB7', 0, +}; + +static const char s_Utf8UpperToLowerE1BD[64 * 4] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xE1', '\xBD', '\x80', 0, + '\xE1', '\xBD', '\x81', 0, + '\xE1', '\xBD', '\x82', 0, + '\xE1', '\xBD', '\x83', 0, + '\xE1', '\xBD', '\x84', 0, + '\xE1', '\xBD', '\x85', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\xCF', '\x85', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\x85', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\x85', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\x85', '\x00', 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + '\xE1', '\xBD', '\x91', 0, + 0, 0, 0, 0, + '\xE1', '\xBD', '\x93', 0, + 0, 0, 0, 0, + '\xE1', '\xBD', '\x95', 0, + 0, 0, 0, 0, + '\xE1', '\xBD', '\x97', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xE1', '\xBD', '\xA0', 0, + '\xE1', '\xBD', '\xA1', 0, + '\xE1', '\xBD', '\xA2', 0, + '\xE1', '\xBD', '\xA3', 0, + '\xE1', '\xBD', '\xA4', 0, + '\xE1', '\xBD', '\xA5', 0, + '\xE1', '\xBD', '\xA6', 0, + '\xE1', '\xBD', '\xA7', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8UpperToLowerE1BE[64 * 4] = { + '\xE1', '\xBC', '\x80', 0, + '\xE1', '\xBC', '\x81', 0, + '\xE1', '\xBC', '\x82', 0, + '\xE1', '\xBC', '\x83', 0, + '\xE1', '\xBC', '\x84', 0, + '\xE1', '\xBC', '\x85', 0, + '\xE1', '\xBC', '\x86', 0, + '\xE1', '\xBC', '\x87', 0, + '\xE1', '\xBE', '\x80', 0, + '\xE1', '\xBE', '\x81', 0, + '\xE1', '\xBE', '\x82', 0, + '\xE1', '\xBE', '\x83', 0, + '\xE1', '\xBE', '\x84', 0, + '\xE1', '\xBE', '\x85', 0, + '\xE1', '\xBE', '\x86', 0, + '\xE1', '\xBE', '\x87', 0, + '\xE1', '\xBC', '\xA0', 0, + '\xE1', '\xBC', '\xA1', 0, + '\xE1', '\xBC', '\xA2', 0, + '\xE1', '\xBC', '\xA3', 0, + '\xE1', '\xBC', '\xA4', 0, + '\xE1', '\xBC', '\xA5', 0, + '\xE1', '\xBC', '\xA6', 0, + '\xE1', '\xBC', '\xA7', 0, + '\xE1', '\xBE', '\x90', 0, + '\xE1', '\xBE', '\x91', 0, + '\xE1', '\xBE', '\x92', 0, + '\xE1', '\xBE', '\x93', 0, + '\xE1', '\xBE', '\x94', 0, + '\xE1', '\xBE', '\x95', 0, + '\xE1', '\xBE', '\x96', 0, + '\xE1', '\xBE', '\x97', 0, + '\xE1', '\xBD', '\xA0', 0, + '\xE1', '\xBD', '\xA1', 0, + '\xE1', '\xBD', '\xA2', 0, + '\xE1', '\xBD', '\xA3', 0, + '\xE1', '\xBD', '\xA4', 0, + '\xE1', '\xBD', '\xA5', 0, + '\xE1', '\xBD', '\xA6', 0, + '\xE1', '\xBD', '\xA7', 0, + '\xE1', '\xBE', '\xA0', 0, + '\xE1', '\xBE', '\xA1', 0, + '\xE1', '\xBE', '\xA2', 0, + '\xE1', '\xBE', '\xA3', 0, + '\xE1', '\xBE', '\xA4', 0, + '\xE1', '\xBE', '\xA5', 0, + '\xE1', '\xBE', '\xA6', 0, + '\xE1', '\xBE', '\xA7', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\xE1', '\xBD', '\xB0', 0, + '\xCE', '\xB1', '\x00', 0, + '\xCE', '\xAC', '\x00', 0, + 0, 0, 0, 0, + '\xCE', '\xB1', '\x00', 0, + '\xCE', '\xB1', '\x00', 0, + '\xE1', '\xBE', '\xB0', 0, + '\xE1', '\xBE', '\xB1', 0, + '\xE1', '\xBD', '\xB0', 0, + '\xE1', '\xBD', '\xB1', 0, + '\xE1', '\xBE', '\xB3', 0, + 0, 0, 0, 0, + '\xCE', '\xB9', '\x00', 0, + 0, 0, 0, 0, +}; + +static const char s_Utf8UpperToLowerE1BF[64 * 4] = { + 0, 0, 0, 0, 0, 0, 0, 0, + '\xE1', '\xBD', '\xB4', 0, + '\xCE', '\xB7', '\x00', 0, + '\xCE', '\xAE', '\x00', 0, + 0, 0, 0, 0, + '\xCE', '\xB7', '\x00', 0, + '\xCE', '\xB7', '\x00', 0, + '\xE1', '\xBD', '\xB2', 0, + '\xE1', '\xBD', '\xB3', 0, + '\xE1', '\xBD', '\xB4', 0, + '\xE1', '\xBD', '\xB5', 0, + '\xE1', '\xBF', '\x83', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\xCE', '\xB9', '\x00', 0, + '\xCE', '\xB9', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\xCE', '\xB9', '\x00', 0, + '\xCE', '\xB9', '\x00', 0, + '\xE1', '\xBF', '\x90', 0, + '\xE1', '\xBF', '\x91', 0, + '\xE1', '\xBD', '\xB6', 0, + '\xE1', '\xBD', '\xB7', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\xCF', '\x85', '\x00', 0, + '\xCF', '\x85', '\x00', 0, + '\xCF', '\x81', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\x85', '\x00', 0, + '\xCF', '\x85', '\x00', 0, + '\xE1', '\xBF', '\xA0', 0, + '\xE1', '\xBF', '\xA1', 0, + '\xE1', '\xBD', '\xBA', 0, + '\xE1', '\xBD', '\xBB', 0, + '\xE1', '\xBF', '\xA5', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\xE1', '\xBD', '\xBC', 0, + '\xCF', '\x89', '\x00', 0, + '\xCF', '\x8E', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\x89', '\x00', 0, + '\xCF', '\x89', '\x00', 0, + '\xE1', '\xBD', '\xB8', 0, + '\xE1', '\xBD', '\xB9', 0, + '\xE1', '\xBD', '\xBC', 0, + '\xE1', '\xBD', '\xBD', 0, + '\xE1', '\xBF', '\xB3', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8UpperToLowerE284[64 * 4] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xCF', '\x89', '\x00', 0, + 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\x6B', '\x00', '\x00', 0, + '\xC3', '\xA5', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8UpperToLowerE285[64 * 4] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xE2', '\x85', '\xB0', 0, + '\xE2', '\x85', '\xB1', 0, + '\xE2', '\x85', '\xB2', 0, + '\xE2', '\x85', '\xB3', 0, + '\xE2', '\x85', '\xB4', 0, + '\xE2', '\x85', '\xB5', 0, + '\xE2', '\x85', '\xB6', 0, + '\xE2', '\x85', '\xB7', 0, + '\xE2', '\x85', '\xB8', 0, + '\xE2', '\x85', '\xB9', 0, + '\xE2', '\x85', '\xBA', 0, + '\xE2', '\x85', '\xBB', 0, + '\xE2', '\x85', '\xBC', 0, + '\xE2', '\x85', '\xBD', 0, + '\xE2', '\x85', '\xBE', 0, + '\xE2', '\x85', '\xBF', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8UpperToLowerE292[64 * 4] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xE2', '\x93', '\x90', 0, + '\xE2', '\x93', '\x91', 0, + '\xE2', '\x93', '\x92', 0, + '\xE2', '\x93', '\x93', 0, + '\xE2', '\x93', '\x94', 0, + '\xE2', '\x93', '\x95', 0, + '\xE2', '\x93', '\x96', 0, + '\xE2', '\x93', '\x97', 0, + '\xE2', '\x93', '\x98', 0, + '\xE2', '\x93', '\x99', 0, +}; + +static const char s_Utf8UpperToLowerE293[64 * 4] = { + '\xE2', '\x93', '\x9A', 0, + '\xE2', '\x93', '\x9B', 0, + '\xE2', '\x93', '\x9C', 0, + '\xE2', '\x93', '\x9D', 0, + '\xE2', '\x93', '\x9E', 0, + '\xE2', '\x93', '\x9F', 0, + '\xE2', '\x93', '\xA0', 0, + '\xE2', '\x93', '\xA1', 0, + '\xE2', '\x93', '\xA2', 0, + '\xE2', '\x93', '\xA3', 0, + '\xE2', '\x93', '\xA4', 0, + '\xE2', '\x93', '\xA5', 0, + '\xE2', '\x93', '\xA6', 0, + '\xE2', '\x93', '\xA7', 0, + '\xE2', '\x93', '\xA8', 0, + '\xE2', '\x93', '\xA9', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8UpperToLowerEFAC[64 * 4] = { + '\x66', '\x00', '\x00', 0, + '\x66', '\x00', '\x00', 0, + '\x66', '\x00', '\x00', 0, + '\x66', '\x00', '\x00', 0, + '\x66', '\x00', '\x00', 0, + '\x73', '\x00', '\x00', 0, + '\x73', '\x00', '\x00', 0, + 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xD5', '\xB4', '\x00', 0, + '\xD5', '\xB4', '\x00', 0, + '\xD5', '\xB4', '\x00', 0, + '\xD5', '\xBE', '\x00', 0, + '\xD5', '\xB4', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8UpperToLowerEFBC[64 * 4] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, + '\xEF', '\xBD', '\x81', 0, + '\xEF', '\xBD', '\x82', 0, + '\xEF', '\xBD', '\x83', 0, + '\xEF', '\xBD', '\x84', 0, + '\xEF', '\xBD', '\x85', 0, + '\xEF', '\xBD', '\x86', 0, + '\xEF', '\xBD', '\x87', 0, + '\xEF', '\xBD', '\x88', 0, + '\xEF', '\xBD', '\x89', 0, + '\xEF', '\xBD', '\x8A', 0, + '\xEF', '\xBD', '\x8B', 0, + '\xEF', '\xBD', '\x8C', 0, + '\xEF', '\xBD', '\x8D', 0, + '\xEF', '\xBD', '\x8E', 0, + '\xEF', '\xBD', '\x8F', 0, + '\xEF', '\xBD', '\x90', 0, + '\xEF', '\xBD', '\x91', 0, + '\xEF', '\xBD', '\x92', 0, + '\xEF', '\xBD', '\x93', 0, + '\xEF', '\xBD', '\x94', 0, + '\xEF', '\xBD', '\x95', 0, + '\xEF', '\xBD', '\x96', 0, + '\xEF', '\xBD', '\x97', 0, + '\xEF', '\xBD', '\x98', 0, + '\xEF', '\xBD', '\x99', 0, + '\xEF', '\xBD', '\x9A', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char *s_Utf8UpperToLowerTables[32] = { + 0, 0, + s_Utf8UpperToLowerC2, + s_Utf8UpperToLowerC3, + s_Utf8UpperToLowerC4, + s_Utf8UpperToLowerC5, + s_Utf8UpperToLowerC6, + s_Utf8UpperToLowerC7, + s_Utf8UpperToLowerC8, + 0, 0, 0, 0, + s_Utf8UpperToLowerCD, + s_Utf8UpperToLowerCE, + s_Utf8UpperToLowerCF, + s_Utf8UpperToLowerD0, + s_Utf8UpperToLowerD1, + s_Utf8UpperToLowerD2, + s_Utf8UpperToLowerD3, + s_Utf8UpperToLowerD4, + s_Utf8UpperToLowerD5, + s_Utf8UpperToLowerD6, + 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char *s_Utf8UpperToLowerTablesE1[64] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + s_Utf8UpperToLowerE1B8, + s_Utf8UpperToLowerE1B9, + s_Utf8UpperToLowerE1BA, + s_Utf8UpperToLowerE1BB, + s_Utf8UpperToLowerE1BC, + s_Utf8UpperToLowerE1BD, + s_Utf8UpperToLowerE1BE, + s_Utf8UpperToLowerE1BF, +}; + +static const char *s_Utf8UpperToLowerTablesE2[64] = { + 0, 0, 0, 0, + s_Utf8UpperToLowerE284, + s_Utf8UpperToLowerE285, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + s_Utf8UpperToLowerE292, + s_Utf8UpperToLowerE293, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char *s_Utf8UpperToLowerTablesEF[64] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + s_Utf8UpperToLowerEFAC, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + s_Utf8UpperToLowerEFBC, + 0, 0, 0, +}; + +static const char **s_UtfUpperToLowerMap[16] = { + 0, + s_Utf8UpperToLowerTablesE1, + s_Utf8UpperToLowerTablesE2, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + s_Utf8UpperToLowerTablesEF, +}; + +// *************************************************************************** +// *************************************************************************** +// *************************************************************************** + +static const char s_Utf8LowerToUpperC3[64 * 4] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + '\x41', '\x00', '\x00', 0, + '\x41', '\x00', '\x00', 0, + '\x41', '\x00', '\x00', 0, + '\x41', '\x00', '\x00', 0, + '\x41', '\x00', '\x00', 0, + '\xC3', '\x86', '\x00', 0, + '\x43', '\x00', '\x00', 0, + '\x45', '\x00', '\x00', 0, + '\x45', '\x00', '\x00', 0, + '\x45', '\x00', '\x00', 0, + '\x45', '\x00', '\x00', 0, + '\x49', '\x00', '\x00', 0, + '\x49', '\x00', '\x00', 0, + '\x49', '\x00', '\x00', 0, + '\x49', '\x00', '\x00', 0, + '\xC3', '\x90', '\x00', 0, + '\x4E', '\x00', '\x00', 0, + '\x4F', '\x00', '\x00', 0, + '\x4F', '\x00', '\x00', 0, + '\x4F', '\x00', '\x00', 0, + '\x4F', '\x00', '\x00', 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + '\x55', '\x00', '\x00', 0, + '\x55', '\x00', '\x00', 0, + '\x55', '\x00', '\x00', 0, + '\x55', '\x00', '\x00', 0, + '\x59', '\x00', '\x00', 0, + '\xC3', '\x9E', '\x00', 0, + '\x59', '\x00', '\x00', 0, +}; + +static const char s_Utf8LowerToUpperC4[64 * 4] = { + 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x43', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x43', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x43', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x43', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x44', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x44', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x45', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x45', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x45', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x45', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x45', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x47', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x47', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x47', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x47', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x48', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x48', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x49', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x49', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x49', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x49', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x49', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\xC4', '\xB2', '\x00', 0, + 0, 0, 0, 0, + '\x4A', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4B', '\x00', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\x4C', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4C', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4C', '\x00', '\x00', 0, + 0, 0, 0, 0, +}; + +static const char s_Utf8LowerToUpperC5[64 * 4] = { + '\x4C', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4C', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4E', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4E', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4E', '\x00', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\xC5', '\x8A', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\xC5', '\x92', '\x00', 0, + 0, 0, 0, 0, + '\x52', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x52', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x52', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x53', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x53', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x53', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x53', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x54', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x54', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x54', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x57', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x59', '\x00', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\x5A', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x5A', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x5A', '\x00', '\x00', 0, + 0, 0, 0, 0, +}; + +static const char s_Utf8LowerToUpperC6[64 * 4] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\x42', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\xC6', '\x84', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\x43', '\x00', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\x44', '\x00', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\x46', '\x00', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\xC7', '\xB6', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, + '\x4B', '\x00', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\x4E', '\x00', '\x00', 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\xC6', '\xA2', '\x00', 0, + 0, 0, 0, 0, + '\x50', '\x00', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\xC6', '\xA7', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\x54', '\x00', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\x59', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x5A', '\x00', '\x00', 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + '\xC6', '\xB8', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xC6', '\xBC', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\xB7', '\x00', 0, +}; + +static const char s_Utf8LowerToUpperC7[64 * 4] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xC7', '\x84', '\x00', 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + '\xC7', '\x87', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\xC7', '\x8A', '\x00', 0, + 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x49', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + '\xC6', '\x8E', '\x00', 0, + 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\xA2', '\x00', 0, + 0, 0, 0, 0, + '\x47', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x47', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4B', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\xAE', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xC7', '\xB1', '\x00', 0, + 0, 0, 0, 0, + '\x47', '\x00', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, + '\x4E', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\xC7', '\xBC', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, +}; + +static const char s_Utf8LowerToUpperC8[64 * 4] = { + 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x45', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x45', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x49', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x49', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x52', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x52', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x53', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x54', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\xC8', '\x9C', '\x00', 0, + 0, 0, 0, 0, + '\x48', '\x00', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xC8', '\xA2', '\x00', 0, + 0, 0, 0, 0, + '\x5A', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x45', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x59', '\x00', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8LowerToUpperC9[64 * 4] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\x42', '\x00', '\x00', 0, + '\xC6', '\x86', '\x00', 0, + 0, 0, 0, 0, + '\xC6', '\x89', '\x00', 0, + '\x44', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\xC6', '\x8F', '\x00', 0, + 0, 0, 0, 0, + '\xC6', '\x90', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\x47', '\x00', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\xC6', '\x94', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\x49', '\x00', '\x00', 0, + '\xC6', '\x96', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xC6', '\x9C', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\x4E', '\x00', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8LowerToUpperCA[64 * 4] = { + '\xC6', '\xA6', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\xC6', '\xA9', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\x54', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\xC6', '\xB1', '\x00', 0, + '\x56', '\x00', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\xC6', '\xB7', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8LowerToUpperCE[64 * 4] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xCE', '\x86', '\x00', 0, + '\xCE', '\x88', '\x00', 0, + '\xCE', '\x89', '\x00', 0, + '\xCE', '\x8A', '\x00', 0, + 0, 0, 0, 0, + '\xCE', '\x91', '\x00', 0, + '\xCE', '\x92', '\x00', 0, + '\xCE', '\x93', '\x00', 0, + '\xCE', '\x94', '\x00', 0, + '\xCE', '\x95', '\x00', 0, + '\xCE', '\x96', '\x00', 0, + '\xCE', '\x97', '\x00', 0, + '\xCE', '\x98', '\x00', 0, + '\xCE', '\x99', '\x00', 0, + '\xCE', '\x9A', '\x00', 0, + '\xCE', '\x9B', '\x00', 0, + '\xCE', '\x9C', '\x00', 0, + '\xCE', '\x9D', '\x00', 0, + '\xCE', '\x9E', '\x00', 0, + '\xCE', '\x9F', '\x00', 0, +}; + +static const char s_Utf8LowerToUpperCF[64 * 4] = { + '\xCE', '\xA0', '\x00', 0, + '\xCE', '\xA1', '\x00', 0, + 0, 0, 0, 0, + '\xCE', '\xA3', '\x00', 0, + '\xCE', '\xA4', '\x00', 0, + '\xCE', '\xA5', '\x00', 0, + '\xCE', '\xA6', '\x00', 0, + '\xCE', '\xA7', '\x00', 0, + '\xCE', '\xA8', '\x00', 0, + '\xCE', '\xA9', '\x00', 0, + '\xCE', '\xAA', '\x00', 0, + '\xCE', '\xAB', '\x00', 0, + '\xCE', '\x8C', '\x00', 0, + '\xCE', '\x8E', '\x00', 0, + '\xCE', '\x8F', '\x00', 0, + 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, + '\xCF', '\x98', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\x9A', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\x9C', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\x9E', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\xA0', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\xA2', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\xA4', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\xA6', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\xA8', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\xAA', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\xAC', '\x00', 0, + 0, 0, 0, 0, + '\xCF', '\xAE', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\xCF', '\xB9', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xCF', '\xB7', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + '\xCF', '\xBA', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8LowerToUpperD0[64 * 4] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xD0', '\x90', '\x00', 0, + '\xD0', '\x91', '\x00', 0, + '\xD0', '\x92', '\x00', 0, + '\xD0', '\x93', '\x00', 0, + '\xD0', '\x94', '\x00', 0, + '\xD0', '\x95', '\x00', 0, + '\xD0', '\x96', '\x00', 0, + '\xD0', '\x97', '\x00', 0, + '\xD0', '\x98', '\x00', 0, + '\xD0', '\x99', '\x00', 0, + '\xD0', '\x9A', '\x00', 0, + '\xD0', '\x9B', '\x00', 0, + '\xD0', '\x9C', '\x00', 0, + '\xD0', '\x9D', '\x00', 0, + '\xD0', '\x9E', '\x00', 0, + '\xD0', '\x9F', '\x00', 0, +}; + +static const char s_Utf8LowerToUpperD1[64 * 4] = { + '\xD0', '\xA0', '\x00', 0, + '\xD0', '\xA1', '\x00', 0, + '\xD0', '\xA2', '\x00', 0, + '\xD0', '\xA3', '\x00', 0, + '\xD0', '\xA4', '\x00', 0, + '\xD0', '\xA5', '\x00', 0, + '\xD0', '\xA6', '\x00', 0, + '\xD0', '\xA7', '\x00', 0, + '\xD0', '\xA8', '\x00', 0, + '\xD0', '\xA9', '\x00', 0, + '\xD0', '\xAA', '\x00', 0, + '\xD0', '\xAB', '\x00', 0, + '\xD0', '\xAC', '\x00', 0, + '\xD0', '\xAD', '\x00', 0, + '\xD0', '\xAE', '\x00', 0, + '\xD0', '\xAF', '\x00', 0, + '\xD0', '\x80', '\x00', 0, + '\xD0', '\x81', '\x00', 0, + '\xD0', '\x82', '\x00', 0, + '\xD0', '\x83', '\x00', 0, + '\xD0', '\x84', '\x00', 0, + '\xD0', '\x85', '\x00', 0, + '\xD0', '\x86', '\x00', 0, + '\xD0', '\x87', '\x00', 0, + '\xD0', '\x88', '\x00', 0, + '\xD0', '\x89', '\x00', 0, + '\xD0', '\x8A', '\x00', 0, + '\xD0', '\x8B', '\x00', 0, + '\xD0', '\x8C', '\x00', 0, + '\xD0', '\x8D', '\x00', 0, + '\xD0', '\x8E', '\x00', 0, + '\xD0', '\x8F', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xA0', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xA2', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xA4', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xA6', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xA8', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xAA', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xAC', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xAE', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xB0', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xB2', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xB4', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xB6', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xB8', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xBA', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xBC', '\x00', 0, + 0, 0, 0, 0, + '\xD1', '\xBE', '\x00', 0, +}; + +static const char s_Utf8LowerToUpperD2[64 * 4] = { + 0, 0, 0, 0, + '\xD2', '\x80', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xD2', '\x8A', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\x8C', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\x8E', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\x90', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\x92', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\x94', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\x96', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\x98', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\x9A', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\x9C', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\x9E', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xA0', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xA2', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xA4', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xA6', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xA8', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xAA', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xAC', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xAE', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xB0', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xB2', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xB4', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xB6', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xB8', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xBA', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xBC', '\x00', 0, + 0, 0, 0, 0, + '\xD2', '\xBE', '\x00', 0, +}; + +static const char s_Utf8LowerToUpperD3[64 * 4] = { + 0, 0, 0, 0, 0, 0, 0, 0, + '\xD3', '\x81', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x83', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x85', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x87', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x89', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x8B', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x8D', '\x00', 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + '\xD3', '\x90', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x92', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x94', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x96', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x98', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x9A', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x9C', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\x9E', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\xA0', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\xA2', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\xA4', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\xA6', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\xA8', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\xAA', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\xAC', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\xAE', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\xB0', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\xB2', '\x00', 0, + 0, 0, 0, 0, + '\xD3', '\xB4', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, + '\xD3', '\xB8', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8LowerToUpperD4[64 * 4] = { + 0, 0, 0, 0, + '\xD4', '\x80', '\x00', 0, + 0, 0, 0, 0, + '\xD4', '\x82', '\x00', 0, + 0, 0, 0, 0, + '\xD4', '\x84', '\x00', 0, + 0, 0, 0, 0, + '\xD4', '\x86', '\x00', 0, + 0, 0, 0, 0, + '\xD4', '\x88', '\x00', 0, + 0, 0, 0, 0, + '\xD4', '\x8A', '\x00', 0, + 0, 0, 0, 0, + '\xD4', '\x8C', '\x00', 0, + 0, 0, 0, 0, + '\xD4', '\x8E', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8LowerToUpperD5[64 * 4] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, + '\xD4', '\xB1', '\x00', 0, + '\xD4', '\xB2', '\x00', 0, + '\xD4', '\xB3', '\x00', 0, + '\xD4', '\xB4', '\x00', 0, + '\xD4', '\xB5', '\x00', 0, + '\xD4', '\xB6', '\x00', 0, + '\xD4', '\xB7', '\x00', 0, + '\xD4', '\xB8', '\x00', 0, + '\xD4', '\xB9', '\x00', 0, + '\xD4', '\xBA', '\x00', 0, + '\xD4', '\xBB', '\x00', 0, + '\xD4', '\xBC', '\x00', 0, + '\xD4', '\xBD', '\x00', 0, + '\xD4', '\xBE', '\x00', 0, + '\xD4', '\xBF', '\x00', 0, + '\xD5', '\x80', '\x00', 0, + '\xD5', '\x81', '\x00', 0, + '\xD5', '\x82', '\x00', 0, + '\xD5', '\x83', '\x00', 0, + '\xD5', '\x84', '\x00', 0, + '\xD5', '\x85', '\x00', 0, + '\xD5', '\x86', '\x00', 0, + '\xD5', '\x87', '\x00', 0, + '\xD5', '\x88', '\x00', 0, + '\xD5', '\x89', '\x00', 0, + '\xD5', '\x8A', '\x00', 0, + '\xD5', '\x8B', '\x00', 0, + '\xD5', '\x8C', '\x00', 0, + '\xD5', '\x8D', '\x00', 0, + '\xD5', '\x8E', '\x00', 0, + '\xD5', '\x8F', '\x00', 0, +}; + +static const char s_Utf8LowerToUpperD6[64 * 4] = { + '\xD5', '\x90', '\x00', 0, + '\xD5', '\x91', '\x00', 0, + '\xD5', '\x92', '\x00', 0, + '\xD5', '\x93', '\x00', 0, + '\xD5', '\x94', '\x00', 0, + '\xD5', '\x95', '\x00', 0, + '\xD5', '\x96', '\x00', 0, + 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8LowerToUpperE1B8[64 * 4] = { + 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x42', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x42', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x42', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x43', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x44', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x44', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x44', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x44', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x44', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x45', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x45', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x45', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x45', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x45', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x46', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x47', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x48', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x48', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x48', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x48', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x48', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x49', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x49', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4B', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4B', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4B', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4C', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4C', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4C', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4C', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4D', '\x00', '\x00', 0, +}; + +static const char s_Utf8LowerToUpperE1B9[64 * 4] = { + 0, 0, 0, 0, + '\x4D', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4D', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4E', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4E', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4E', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4E', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x50', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x50', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x52', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x52', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x52', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x52', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x53', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x53', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x53', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x53', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x53', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x54', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x54', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x54', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x54', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x56', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x56', '\x00', '\x00', 0, +}; + +static const char s_Utf8LowerToUpperE1BA[64 * 4] = { + 0, 0, 0, 0, + '\x57', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x57', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x57', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x57', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x57', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x58', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x58', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x59', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x5A', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x5A', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x5A', '\x00', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x45', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x45', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x45', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x45', '\x00', '\x00', 0, +}; + +static const char s_Utf8LowerToUpperE1BB[64 * 4] = { + 0, 0, 0, 0, + '\x45', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x45', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x45', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x45', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x49', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x49', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x4F', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x55', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x59', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x59', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x59', '\x00', '\x00', 0, + 0, 0, 0, 0, + '\x59', '\x00', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8LowerToUpperE1BC[64 * 4] = { + '\xE1', '\xBC', '\x88', 0, + '\xE1', '\xBC', '\x89', 0, + '\xE1', '\xBC', '\x8A', 0, + '\xE1', '\xBC', '\x8B', 0, + '\xE1', '\xBC', '\x8C', 0, + '\xE1', '\xBC', '\x8D', 0, + '\xE1', '\xBC', '\x8E', 0, + '\xE1', '\xBC', '\x8F', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xE1', '\xBC', '\x98', 0, + '\xE1', '\xBC', '\x99', 0, + '\xE1', '\xBC', '\x9A', 0, + '\xE1', '\xBC', '\x9B', 0, + '\xE1', '\xBC', '\x9C', 0, + '\xE1', '\xBC', '\x9D', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xE1', '\xBC', '\xA8', 0, + '\xE1', '\xBC', '\xA9', 0, + '\xE1', '\xBC', '\xAA', 0, + '\xE1', '\xBC', '\xAB', 0, + '\xE1', '\xBC', '\xAC', 0, + '\xE1', '\xBC', '\xAD', 0, + '\xE1', '\xBC', '\xAE', 0, + '\xE1', '\xBC', '\xAF', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xE1', '\xBC', '\xB8', 0, + '\xE1', '\xBC', '\xB9', 0, + '\xE1', '\xBC', '\xBA', 0, + '\xE1', '\xBC', '\xBB', 0, + '\xE1', '\xBC', '\xBC', 0, + '\xE1', '\xBC', '\xBD', 0, + '\xE1', '\xBC', '\xBE', 0, + '\xE1', '\xBC', '\xBF', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8LowerToUpperE1BD[64 * 4] = { + '\xE1', '\xBD', '\x88', 0, + '\xE1', '\xBD', '\x89', 0, + '\xE1', '\xBD', '\x8A', 0, + '\xE1', '\xBD', '\x8B', 0, + '\xE1', '\xBD', '\x8C', 0, + '\xE1', '\xBD', '\x8D', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, + '\xE1', '\xBD', '\x99', 0, + 0, 0, 0, 0, + '\xE1', '\xBD', '\x9B', 0, + 0, 0, 0, 0, + '\xE1', '\xBD', '\x9D', 0, + 0, 0, 0, 0, + '\xE1', '\xBD', '\x9F', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xE1', '\xBD', '\xA8', 0, + '\xE1', '\xBD', '\xA9', 0, + '\xE1', '\xBD', '\xAA', 0, + '\xE1', '\xBD', '\xAB', 0, + '\xE1', '\xBD', '\xAC', 0, + '\xE1', '\xBD', '\xAD', 0, + '\xE1', '\xBD', '\xAE', 0, + '\xE1', '\xBD', '\xAF', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xE1', '\xBE', '\xBA', 0, + '\xE1', '\xBE', '\xBB', 0, + '\xE1', '\xBF', '\x88', 0, + '\xE1', '\xBF', '\x89', 0, + '\xE1', '\xBF', '\x8A', 0, + '\xE1', '\xBF', '\x8B', 0, + '\xE1', '\xBF', '\x9A', 0, + '\xE1', '\xBF', '\x9B', 0, + '\xE1', '\xBF', '\xB8', 0, + '\xE1', '\xBF', '\xB9', 0, + '\xE1', '\xBF', '\xAA', 0, + '\xE1', '\xBF', '\xAB', 0, + '\xE1', '\xBF', '\xBA', 0, + '\xE1', '\xBF', '\xBB', 0, + 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8LowerToUpperE1BE[64 * 4] = { + '\xE1', '\xBE', '\x88', 0, + '\xE1', '\xBE', '\x89', 0, + '\xE1', '\xBE', '\x8A', 0, + '\xE1', '\xBE', '\x8B', 0, + '\xE1', '\xBE', '\x8C', 0, + '\xE1', '\xBE', '\x8D', 0, + '\xE1', '\xBE', '\x8E', 0, + '\xE1', '\xBE', '\x8F', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xE1', '\xBE', '\x98', 0, + '\xE1', '\xBE', '\x99', 0, + '\xE1', '\xBE', '\x9A', 0, + '\xE1', '\xBE', '\x9B', 0, + '\xE1', '\xBE', '\x9C', 0, + '\xE1', '\xBE', '\x9D', 0, + '\xE1', '\xBE', '\x9E', 0, + '\xE1', '\xBE', '\x9F', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xE1', '\xBE', '\xA8', 0, + '\xE1', '\xBE', '\xA9', 0, + '\xE1', '\xBE', '\xAA', 0, + '\xE1', '\xBE', '\xAB', 0, + '\xE1', '\xBE', '\xAC', 0, + '\xE1', '\xBE', '\xAD', 0, + '\xE1', '\xBE', '\xAE', 0, + '\xE1', '\xBE', '\xAF', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xE1', '\xBE', '\xB8', 0, + '\xE1', '\xBE', '\xB9', 0, + 0, 0, 0, 0, + '\xE1', '\xBE', '\xBC', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8LowerToUpperE1BF[64 * 4] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xE1', '\xBF', '\x8C', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xE1', '\xBF', '\x98', 0, + '\xE1', '\xBF', '\x99', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xE1', '\xBF', '\xA8', 0, + '\xE1', '\xBF', '\xA9', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xE1', '\xBF', '\xAC', 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xE1', '\xBF', '\xBC', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8LowerToUpperE285[64 * 4] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\xE2', '\x85', '\xA0', 0, + '\xE2', '\x85', '\xA1', 0, + '\xE2', '\x85', '\xA2', 0, + '\xE2', '\x85', '\xA3', 0, + '\xE2', '\x85', '\xA4', 0, + '\xE2', '\x85', '\xA5', 0, + '\xE2', '\x85', '\xA6', 0, + '\xE2', '\x85', '\xA7', 0, + '\xE2', '\x85', '\xA8', 0, + '\xE2', '\x85', '\xA9', 0, + '\xE2', '\x85', '\xAA', 0, + '\xE2', '\x85', '\xAB', 0, + '\xE2', '\x85', '\xAC', 0, + '\xE2', '\x85', '\xAD', 0, + '\xE2', '\x85', '\xAE', 0, + '\xE2', '\x85', '\xAF', 0, +}; + +static const char s_Utf8LowerToUpperE293[64 * 4] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + '\x42', '\x00', '\x00', 0, + '\x43', '\x00', '\x00', 0, + '\x44', '\x00', '\x00', 0, + '\x45', '\x00', '\x00', 0, + '\x46', '\x00', '\x00', 0, + '\x47', '\x00', '\x00', 0, + '\x48', '\x00', '\x00', 0, + '\x49', '\x00', '\x00', 0, + '\x4A', '\x00', '\x00', 0, + '\x4B', '\x00', '\x00', 0, + '\x4C', '\x00', '\x00', 0, + '\x4D', '\x00', '\x00', 0, + '\x4E', '\x00', '\x00', 0, + '\x4F', '\x00', '\x00', 0, + '\x50', '\x00', '\x00', 0, + '\x51', '\x00', '\x00', 0, + '\x52', '\x00', '\x00', 0, + '\x53', '\x00', '\x00', 0, + '\x54', '\x00', '\x00', 0, + '\x55', '\x00', '\x00', 0, + '\x56', '\x00', '\x00', 0, + '\x57', '\x00', '\x00', 0, + '\x58', '\x00', '\x00', 0, + '\x59', '\x00', '\x00', 0, + '\x5A', '\x00', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char s_Utf8LowerToUpperEFBD[64 * 4] = { + 0, 0, 0, 0, + '\x41', '\x00', '\x00', 0, + '\x42', '\x00', '\x00', 0, + '\x43', '\x00', '\x00', 0, + '\x44', '\x00', '\x00', 0, + '\x45', '\x00', '\x00', 0, + '\x46', '\x00', '\x00', 0, + '\x47', '\x00', '\x00', 0, + '\x48', '\x00', '\x00', 0, + '\x49', '\x00', '\x00', 0, + '\x4A', '\x00', '\x00', 0, + '\x4B', '\x00', '\x00', 0, + '\x4C', '\x00', '\x00', 0, + '\x4D', '\x00', '\x00', 0, + '\x4E', '\x00', '\x00', 0, + '\x4F', '\x00', '\x00', 0, + '\x50', '\x00', '\x00', 0, + '\x51', '\x00', '\x00', 0, + '\x52', '\x00', '\x00', 0, + '\x53', '\x00', '\x00', 0, + '\x54', '\x00', '\x00', 0, + '\x55', '\x00', '\x00', 0, + '\x56', '\x00', '\x00', 0, + '\x57', '\x00', '\x00', 0, + '\x58', '\x00', '\x00', 0, + '\x59', '\x00', '\x00', 0, + '\x5A', '\x00', '\x00', 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char *s_Utf8LowerToUpperTables[32] = { + 0, 0, 0, + s_Utf8LowerToUpperC3, + s_Utf8LowerToUpperC4, + s_Utf8LowerToUpperC5, + s_Utf8LowerToUpperC6, + s_Utf8LowerToUpperC7, + s_Utf8LowerToUpperC8, + s_Utf8LowerToUpperC9, + s_Utf8LowerToUpperCA, + 0, 0, 0, + s_Utf8LowerToUpperCE, + s_Utf8LowerToUpperCF, + s_Utf8LowerToUpperD0, + s_Utf8LowerToUpperD1, + s_Utf8LowerToUpperD2, + s_Utf8LowerToUpperD3, + s_Utf8LowerToUpperD4, + s_Utf8LowerToUpperD5, + s_Utf8LowerToUpperD6, + 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char *s_Utf8LowerToUpperTablesE1[64] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + s_Utf8LowerToUpperE1B8, + s_Utf8LowerToUpperE1B9, + s_Utf8LowerToUpperE1BA, + s_Utf8LowerToUpperE1BB, + s_Utf8LowerToUpperE1BC, + s_Utf8LowerToUpperE1BD, + s_Utf8LowerToUpperE1BE, + s_Utf8LowerToUpperE1BF, +}; + +static const char *s_Utf8LowerToUpperTablesE2[64] = { + 0, 0, 0, 0, 0, + s_Utf8LowerToUpperE285, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + s_Utf8LowerToUpperE293, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char *s_Utf8LowerToUpperTablesEF[64] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + s_Utf8LowerToUpperEFBD, + 0, 0, +}; + +static const char **s_UtfLowerToUpperMap[16] = { + 0, + s_Utf8LowerToUpperTablesE1, + s_Utf8LowerToUpperTablesE2, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + s_Utf8LowerToUpperTablesEF, +}; + +// *************************************************************************** +// *************************************************************************** +// *************************************************************************** + +#if 1 + +NL_FORCE_INLINE void appendToLowerAsUtf8(std::string &res, const char *str, ptrdiff_t &i) +{ + char c = str[i]; + char d, e; + if (c < 0x80) + { + if (c >= 'A' && c <= 'Z') + { + // 1-byte UTF-8 + c += 'a' - 'A'; + } + } + else if ((c & 0xE0) == 0xC0 && ((d = str[i + 1]) & 0xC0) == 0x80) + { + // 2-byte UTF-8 + const char *table = s_Utf8UpperToLowerTables[c & 0x1F]; + if (table) + { + unsigned char idx = (d & 0x3F) << 2; + if (table[idx]) + { + res += &table[idx]; + ++i; + return; + } + } + } + else if ((c & 0xF0) == 0xE0 && ((d = str[i + 1]) & 0xC0) == 0x80 && ((e = str[i + 2]) & 0xC0) == 0x80) + { + // 3-byte UTF-8 + const char **map = s_UtfUpperToLowerMap[c & 0x0F]; + if (map) + { + const char *table = map[d & 0x3F]; + if (table) + { + unsigned char idx = (d & 0x3F) << 2; + if (table[idx]) + { + res += &table[idx]; + i += 2; + return; + } + } + } + } + res += c; +} + +std::string toLower(const char *str) +{ + // UTF-8 toLower, tables generated from UTF-16 tables + std::string res; + for (ptrdiff_t i = 0; str[i]; ++i) + appendToLowerAsUtf8(res, str, i); + return res; +} + +// *************************************************************************** + +std::string toLower(const std::string &str) +{ + // UTF-8 toLower, tables generated from UTF-16 tables + std::string res; + res.reserve(str.size() + (str.size() >> 2)); + const char *cstr = &str[0]; + for (ptrdiff_t i = 0; i < (ptrdiff_t)str.size(); ++i) + appendToLowerAsUtf8(res, cstr, i); + return res; +} + +// *************************************************************************** +// *************************************************************************** +// *************************************************************************** + +NL_FORCE_INLINE void appendToUpperAsUtf8(std::string &res, const char *str, ptrdiff_t &i) +{ + char c = str[i]; + char d, e; + if (c < 0x80) + { + if (c >= 'a' && c <= 'z') + { + // 1-byte UTF-8 + c -= 'a' - 'A'; + } + } + else if ((c & 0xE0) == 0xC0 && ((d = str[i + 1]) & 0xC0) == 0x80) + { + // 2-byte UTF-8 + const char *table = s_Utf8LowerToUpperTables[c & 0x1F]; + if (table) + { + unsigned char idx = (d & 0x3F) << 2; + if (table[idx]) + { + res += &table[idx]; + ++i; + return; + } + } + } + else if ((c & 0xF0) == 0xE0 && ((d = str[i + 1]) & 0xC0) == 0x80 && ((e = str[i + 2]) & 0xC0) == 0x80) + { + // 3-byte UTF-8 + const char **map = s_UtfLowerToUpperMap[c & 0x0F]; + if (map) + { + const char *table = map[d & 0x3F]; + if (table) + { + unsigned char idx = (d & 0x3F) << 2; + if (table[idx]) + { + res += &table[idx]; + i += 2; + return; + } + } + } + } + res += c; +} + +// *************************************************************************** + +std::string toUpper(const char *str) +{ + // UTF-8 toLower, tables generated from UTF-16 tables + std::string res; + for (ptrdiff_t i = 0; str[i]; ++i) + appendToUpperAsUtf8(res, str, i); + return res; +} + +// *************************************************************************** + +std::string toUpper(const std::string &str) +{ + // UTF-8 toLower, tables generated from UTF-16 tables + std::string res; + res.reserve(str.size() + (str.size() >> 2)); + const char *cstr = &str[0]; + for (ptrdiff_t i = 0; i < (ptrdiff_t)str.size(); ++i) + appendToUpperAsUtf8(res, cstr, i); + return res; +} + +// *************************************************************************** + +#else + +// *************************************************************************** + +static std::string toLowerAsUtf8(CUtfStringView sv) +{ + // UTF-16 implementation-based + std::string res; + res.reserve(sv.largestSize()); + for (CUtfStringView::iterator it(sv.begin()), end(sv.end()); it != end; ++it) + { + u32char c = *it; + if (c < 0x10000) + { + ucchar uc = c; + ucchar *result = toLowerUpperSearch(&uc, UnicodeUpperToLower); + if (result) + c = result[1]; + } + CUtfStringView::append(res, c); + } + return res; +} + +std::string toLowerAsUtf8(const char *str) +{ + return toLowerAsUtf8(CUtfStringView(str)); +} + +// *************************************************************************** + +std::string toLowerAsUtf8(const std::string &str) +{ + return toLowerAsUtf8(CUtfStringView(str)); +} + +// *************************************************************************** +// *************************************************************************** // *************************************************************************** static std::string toUpperAsUtf8(CUtfStringView sv) @@ -2044,6 +4936,8 @@ static std::string toUpperAsUtf8(CUtfStringView sv) return res; } +// *************************************************************************** + std::string toUpperAsUtf8(const char *str) { return toUpperAsUtf8(CUtfStringView(str)); @@ -2056,6 +4950,219 @@ std::string toUpperAsUtf8(const std::string &str) return toUpperAsUtf8(CUtfStringView(str)); } +#endif + +// *************************************************************************** +// *************************************************************************** +// *************************************************************************** + +#if 0 + +std::string getUtf8(char32_t c) +{ + std::string res; + if (c < 0x80) + { + // Encode as 1 byte + res += (char)c; + } + else if (c < 0x0800) + { + // Encode as 2 bytes + res += (char)((c & 0x07C0) >> 6) | 0xC0; + res += (char)(c & 0x3F) | 0x80; + } + else + { + // Encode as 3 bytes + res += (char)((c & 0xF000) >> 12) | 0xE0; + res += (char)((c & 0x0FC0) >> 6) | 0x80; + res += (char)(c & 0x3F) | 0x80; + } + return res; +} + +void printStringMap(const std::string &name, std::map &m, bool trim) +{ + std::cout << "static const char " << name << "[" << (trim ? "64" : "256") << " * 4] = {\n"; + bool zero = false; + for (int i = 0; i < (trim ? 64 : 256); ++i) + { + int x = trim ? i + 0x80 : i; + if (m.find(x) == m.end()) + { + if (x % 8 == 7) + { + zero = false; + std::cout << "0, 0, 0, 0,\n"; + } + else + { + zero = true; + std::cout << "0, 0, 0, 0, "; + } + } + else + { + if (zero) std::cout << "\n"; + std::cout << "'\\x" << std::hex << std::setw(2) << std::setfill('0') << std::uppercase << (m[x].length() > 0 ? (unsigned char)m[x][0] : 0) + << "', '\\x" << std::hex << std::setw(2) << std::setfill('0') << std::uppercase << (m[x].length() > 1 ? (unsigned char)m[x][1] : 0) + << "', '\\x" << std::hex << std::setw(2) << std::setfill('0') << std::uppercase << (m[x].length() > 2 ? (unsigned char)m[x][2] : 0) + << "', 0,\n"; + zero = false; + } + } + if (zero) std::cout << "\n"; + std::cout << "};\n\n"; +} + +void printMapMap(const std::string &name, const std::string &strName, std::map> &m, bool trim) +{ + std::cout << "static const char *" << name << "[" << (trim ? "64" : "256") << " * 2] = {\n"; + bool zero = false; + for (int i = 0; i < (trim ? 64 : 256); ++i) + { + int x = trim ? (i + 0x80) : i; + if (m.find(x) == m.end()) + x = trim ? (i + 0xC0) : i; + if (m.find(x) == m.end()) + { + if (x % 32 == 1315) + { + zero = false; + std::cout << "0, \n"; + } + else + { + zero = true; + std::cout << "0, "; + } + } + else + { + if (zero) std::cout << "\n"; + std::stringstream n; + n << strName; + n << std::hex << std::setw(2) << std::setfill('0') << std::uppercase << (unsigned int)x; + std::cout << n.str() << ",\n"; + zero = false; + } + } + if (zero) std::cout << "\n"; + std::cout << "};\n\n"; +} + +void printMapMapMap(const std::string &name, const std::string &mapName, std::map>> &m, bool trim) +{ + std::cout << "static const char **" << name << "[" << (trim ? "64" : "256") << " * 2] = {\n"; + bool zero = false; + for (int i = 0; i < (trim ? 64 : 256); ++i) + { + int x = trim ? (i + 0x80) : i; + if (m.find(x) == m.end()) + x = trim ? (i + 0xC0) : i; + if (m.find(x) == m.end()) + { + if (x % 32 == 1315) + { + zero = false; + std::cout << "0, \n"; + } + else + { + zero = true; + std::cout << "0, "; + } + } + else + { + if (zero) std::cout << "\n"; + std::stringstream n; + n << mapName; + n << std::hex << std::setw(2) << std::setfill('0') << std::uppercase << (unsigned int)x; + std::cout << n.str() << ",\n"; + zero = false; + } + } + if (zero) std::cout << "\n"; + std::cout << "};\n\n"; +} + +void generate() +{ + std::map m1; + std::map> m2; + std::map>> m3; + for (int i = 0; i < sizeof(UnicodeLowerToUpper) / sizeof(UnicodeLowerToUpper[0]); i += 2) + { + std::string from = getUtf8(UnicodeLowerToUpper[i]); + std::string to = getUtf8(UnicodeLowerToUpper[i + 1]); + // assert(from.size() == to.size()); + if (from.length() == 1) + { + m1[from[0]] = to; + } + else if (from.length() == 2) + { + if (m2.find(from[0]) == m2.end()) + m2[from[0]] = std::map(); + m2[from[0]][from[1]] = to; + } + else if (from.length() == 3) + { + if (m3.find(from[0]) == m3.end()) + m3[from[0]] = std::map>(); + if (m3[from[0]].find(from[1]) == m3[from[0]].end()) + m3[from[0]][from[1]] = std::map(); + m3[from[0]][from[1]][from[2]] = to; + } + } + printStringMap("s_Utf8LowerToUpper", m1, false); + for (int i = 0; i < 256; ++i) + { + std::stringstream n; + n << "s_Utf8LowerToUpper"; + if (m2.find(i) != m2.end()) + { + n << std::hex << std::setw(2) << std::setfill('0') << std::uppercase << (unsigned int)i; + printStringMap(n.str(), m2[i], true); + } + else if (m3.find(i) != m3.end()) + { + n << std::hex << std::setw(2) << std::setfill('0') << std::uppercase << (unsigned int)i; + for (int j = 0; j < 256; ++j) + { + if (m3[i].find(j) != m3[i].end()) + { + std::stringstream nn; + nn << n.str(); + nn << std::hex << std::setw(2) << std::setfill('0') << std::uppercase << (unsigned int)j; + printStringMap(nn.str(), m3[i][j], true); + } + } + } + } + printMapMap("s_Utf8LowerToUpperTables", "s_Utf8LowerToUpper", m2, true); + for (int i = 0; i < 256; ++i) + { + std::stringstream n; + n << "s_Utf8LowerToUpperTables"; + std::stringstream nn; + nn << "s_Utf8LowerToUpper"; + if (m3.find(i) != m3.end()) + { + n << std::hex << std::setw(2) << std::setfill('0') << std::uppercase << (unsigned int)i; + nn << std::hex << std::setw(2) << std::setfill('0') << std::uppercase << (unsigned int)i; + printMapMap(n.str(), nn.str(), m3[i], true); + } + } + printMapMapMap("s_UtfLowerToUpperMap", "s_Utf8LowerToUpperTables", m3, true); +} + +#endif + +// *************************************************************************** +// *************************************************************************** // *************************************************************************** } // NLMISC diff --git a/nel/src/misc/utf_string_view.cpp b/nel/src/misc/utf_string_view.cpp index 9f4057b66..070745202 100644 --- a/nel/src/misc/utf_string_view.cpp +++ b/nel/src/misc/utf_string_view.cpp @@ -72,7 +72,7 @@ std::string CUtfStringView::toUtf8(bool reEncode) const return std::string((const char *)m_Str, (const char *)((ptrdiff_t)m_Str + m_Size)); std::string res; res.reserve(m_Size); - for (iterator it(begin()), end(end()); it != end; ++it) + for (iterator it(begin()), end(this->end()); it != end; ++it) { appendUtf8(res, *it); } @@ -85,7 +85,7 @@ ucstring CUtfStringView::toUtf16(bool reEncode) const return ucstring((const ucchar *)m_Str, (const ucchar *)((ptrdiff_t)m_Str + m_Size)); ucstring res; res.reserve(m_Size << 1); - for (iterator it(begin()), end(end()); it != end; ++it) + for (iterator it(begin()), end(this->end()); it != end; ++it) { u32char c = *it; if (c < 0x10000) @@ -102,15 +102,15 @@ ucstring CUtfStringView::toUtf16(bool reEncode) const return res; } -u32string CUtfStringView::toUtf32() const +::u32string CUtfStringView::toUtf32() const { // Decode any UTF // This implementation makes no attempt at fixing bad encoding if (m_Iterator == utf32Iterator) - return u32string((const u32char *)m_Str, (const u32char *)((ptrdiff_t)m_Str + m_Size)); - u32string res; + return ::u32string((const u32char *)m_Str, (const u32char *)((ptrdiff_t)m_Str + m_Size)); + ::u32string res; res.reserve(m_Size << 2); - for (iterator it(begin()), end(end()); it != end; ++it) + for (iterator it(begin()), end(this->end()); it != end; ++it) res += *it; return res; } @@ -119,7 +119,7 @@ std::string CUtfStringView::toAscii() const { std::string res; res.reserve(m_Size); - for (iterator it(begin()), end(end()); it != end; ++it) + for (iterator it(begin()), end(this->end()); it != end; ++it) { u32char c = *it; if (c < 0x80) @@ -137,7 +137,7 @@ std::wstring CUtfStringView::toWide() const return std::wstring((const wchar_t *)m_Str, (const wchar_t *)((ptrdiff_t)m_Str + m_Size)); std::wstring res; res.reserve(m_Size << 1); - for (iterator it(begin()), end(end()); it != end; ++it) + for (iterator it(begin()), end(this->end()); it != end; ++it) { u32char c = *it; if (c < 0x10000) @@ -157,7 +157,7 @@ std::wstring CUtfStringView::toWide() const return std::wstring((const wchar_t *)m_Str, (const wchar_t *)((ptrdiff_t)m_Str + m_Size)); std::wstring res; res.reserve(m_Size << 2); - for (iterator it(begin()), end(end()); it != end; ++it) + for (iterator it(begin()), end(this->end()); it != end; ++it) res += *it; return res; #endif @@ -166,7 +166,7 @@ std::wstring CUtfStringView::toWide() const size_t CUtfStringView::count() const { size_t res = 0; - for (iterator it(begin()), end(end()); it != end; ++it) + for (iterator it(begin()), end(this->end()); it != end; ++it) ++res; return res; } diff --git a/nel/src/misc/win_event_emitter.cpp b/nel/src/misc/win_event_emitter.cpp index 5b6860794..0d370cffc 100644 --- a/nel/src/misc/win_event_emitter.cpp +++ b/nel/src/misc/win_event_emitter.cpp @@ -162,6 +162,14 @@ bool CWinEventEmitter::processMessage (HWND hWnd, uint32 msg, WPARAM wParam, LPA server->postEvent (new CEventKeyUp ((NLMISC::TKey)wParam, getKeyButton(_AltButton, _ShiftButton, _CtrlButton), this)); } break; + case WM_UNICHAR: + if (wParam != UNICODE_NOCHAR && _KeyboardEventsEnabled) + { + //if (wParam < KeyCount) + //nlinfo("WM_UNICHAR with %u", wParam); + server->postEvent (new CEventChar ((u32char)wParam, getKeyButton(_AltButton, _ShiftButton, _CtrlButton), this)); + } + break; case WM_CHAR: if (_KeyboardEventsEnabled) { diff --git a/ryzom/client/src/actions.cpp b/ryzom/client/src/actions.cpp index 783088b21..428c607f0 100644 --- a/ryzom/client/src/actions.cpp +++ b/ryzom/client/src/actions.cpp @@ -499,9 +499,9 @@ void CCombo::init (NLMISC::TKey key, NLMISC::TKeyButton keyButtons) } // *************************************************************************** -ucstring CCombo::toUCString() const +string CCombo::toString() const { - ucstring ret; + string ret; if ((KeyButtons & shiftKeyButton) && (Key != 0x10)) ret += CI18N::get("uiKeySHIFT") + "+"; if ((KeyButtons & ctrlKeyButton) && (Key != 0x11)) diff --git a/ryzom/client/src/actions.h b/ryzom/client/src/actions.h index 1e1bffb84..3fe976ac4 100644 --- a/ryzom/client/src/actions.h +++ b/ryzom/client/src/actions.h @@ -66,7 +66,7 @@ public: void init (NLMISC::TKey key, NLMISC::TKeyButton keyButtons); /// Get the combo in human readable form - ucstring toUCString() const; + std::string toString() const; // For maps bool operator<(const CCombo &other) const diff --git a/ryzom/client/src/bg_downloader_access.cpp b/ryzom/client/src/bg_downloader_access.cpp index 61364ea5f..2a0e2d73a 100644 --- a/ryzom/client/src/bg_downloader_access.cpp +++ b/ryzom/client/src/bg_downloader_access.cpp @@ -230,7 +230,7 @@ void CBGDownloaderAccess::CDownloadCoTask::run() // that the downloader is still running and in slave mode if (!isDownloaderProcessRunning() && getDownloaderMode() != DownloaderMode_Slave) { - throw EDownloadException(CI18N::get("uiBGD_DownloaderStopped").toUtf8()); + throw EDownloadException(CI18N::get("uiBGD_DownloaderStopped")); } } else @@ -429,7 +429,7 @@ void CBGDownloaderAccess::CDownloadCoTask::createDownloaderProcess() BOOL ok = NLMISC::launchProgram(BGDownloaderName, Parent->_CommandLine); if (!ok) { - throw EDownloadException(CI18N::get("uiBGD_LaunchError").toUtf8()); + throw EDownloadException(CI18N::get("uiBGD_LaunchError")); } } else @@ -458,7 +458,7 @@ void CBGDownloaderAccess::CDownloadCoTask::restartDownloader() { nlwarning("CBGDownloaderAccess::CDownloadCoTask : detected shared memory segment, with NULL pid"); // some problem here ... - throw EDownloadException(CI18N::get("uiBGD_MultipleRyzomInstance").toUtf8()); + throw EDownloadException(CI18N::get("uiBGD_MultipleRyzomInstance")); } } bool ok = NLMISC::CWinProcess::terminateProcess(*(DWORD *) ryzomInstPIDPtr); @@ -467,7 +467,7 @@ void CBGDownloaderAccess::CDownloadCoTask::restartDownloader() { nlwarning("CBGDownloaderAccess::CDownloadCoTask : detected shared memory segment, with good pid, but couldn't stop the process"); // couldn't stop the other client ... - throw EDownloadException(CI18N::get("uiBGD_MultipleRyzomInstance").toUtf8()); + throw EDownloadException(CI18N::get("uiBGD_MultipleRyzomInstance")); } } // write our pid into shared mem @@ -475,7 +475,7 @@ void CBGDownloaderAccess::CDownloadCoTask::restartDownloader() if (!Parent->_RyzomInstPIDPtr) { // really, really bad luck ... - throw EDownloadException(CI18N::get("uiBGD_MultipleRyzomInstance").toUtf8()); + throw EDownloadException(CI18N::get("uiBGD_MultipleRyzomInstance")); } *(uint32 *) Parent->_RyzomInstPIDPtr = (uint32) GetCurrentProcessId(); @@ -514,7 +514,7 @@ void CBGDownloaderAccess::CDownloadCoTask::restartDownloader() const uint32 totalTries = 7; while (waitTime <= 32000) { - Parent->_CurrentMessage.fromUtf8(toString(CI18N::get("uiBGD_HandShaking").toUtf8().c_str(), tryIndex, totalTries)); + Parent->_CurrentMessage.fromUtf8(toString(CI18N::get("uiBGD_HandShaking").c_str(), tryIndex, totalTries)); sendSimpleMsg(CL_Probe); NLMISC::CMemStream dummyMsg; @@ -758,7 +758,7 @@ void CBGDownloaderAccess::CDownloadCoTask::waitMsg(BGDownloader::TMsgType wanted if (msgType != wantedMsgType) { nlwarning("BG DOWNLOADER PROTOCOL ERROR ! Bad message type received. Expected type is '%d', received type is '%d'", (int) wantedMsgType, (int) msgType); - throw EDownloadException(CI18N::get("uiBGD_ProtocolError").toUtf8()); + throw EDownloadException(CI18N::get("uiBGD_ProtocolError")); } } @@ -816,7 +816,7 @@ void CBGDownloaderAccess::CDownloadCoTask::checkDownloaderAlive() { if (!Parent->_DownloaderMsgQueue.connected() || !isDownloaderProcessRunning()) { - throw EDownloadException(CI18N::get("uiBGD_DownloaderDisconnected").toUtf8()); + throw EDownloadException(CI18N::get("uiBGD_DownloaderDisconnected")); } } diff --git a/ryzom/client/src/client_chat_manager.cpp b/ryzom/client/src/client_chat_manager.cpp index 243eaf468..b457c541f 100644 --- a/ryzom/client/src/client_chat_manager.cpp +++ b/ryzom/client/src/client_chat_manager.cpp @@ -1175,9 +1175,9 @@ class CHandlerTell : public IActionHandler void execute (CCtrlBase *pCaller, const std::string &sParams) { string receiver = getParam (sParams, "player"); - ucstring message; - message.fromUtf8(getParam (sParams, "text")); -// message = getParam (sParams, "text"); + string message; + message = getParam (sParams, "text"); + if (receiver.empty() || message.empty()) return; @@ -1193,10 +1193,10 @@ class CHandlerTell : public IActionHandler // display in the good window CInterfaceProperty prop; prop.readRGBA("UI:SAVE:CHAT:COLORS:SPEAKER"," "); - ucstring finalMsg; + string finalMsg; CChatWindow::encodeColorTag(prop.getRGBA(), finalMsg, false); - ucstring csr(CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : ""); + string csr(CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : ""); finalMsg += csr + CI18N::get("youTell") + ": "; prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," "); CChatWindow::encodeColorTag(prop.getRGBA(), finalMsg, true); @@ -1205,7 +1205,7 @@ class CHandlerTell : public IActionHandler // TDataSetIndex dsi; // not used .... PeopleInterraction.ChatInput.Tell.displayTellMessage(/*dsi, */finalMsg, receiver, prop.getRGBA()); - ucstring s = CI18N::get("youTellPlayer"); + string s = CI18N::get("youTellPlayer"); strFindReplace(s, "%name", receiver); strFindReplace(finalMsg, CI18N::get("youTell"), s); CInterfaceManager::getInstance()->log(finalMsg, CChatGroup::groupTypeToString(CChatGroup::tell)); @@ -1340,9 +1340,7 @@ class CHandlerTalk : public IActionHandler // Param uint mode; fromString(getParam (sParams, "mode"), mode); - ucstring text; - text.fromUtf8 (getParam (sParams, "text")); -// text = getParam (sParams, "text"); + string text = getParam (sParams, "text"); // Parse any tokens in the text if ( ! CInterfaceManager::parseTokens(text)) @@ -1355,7 +1353,7 @@ class CHandlerTalk : public IActionHandler { if(text[0] == '/') { - string str = text.toUtf8(); + string str = text; string cmdWithArgs = str.substr(1); // Get the command name from the string, can contain spaces diff --git a/ryzom/client/src/client_sheets/item_sheet.cpp b/ryzom/client/src/client_sheets/item_sheet.cpp index 5c56cfa39..0f1404627 100644 --- a/ryzom/client/src/client_sheets/item_sheet.cpp +++ b/ryzom/client/src/client_sheets/item_sheet.cpp @@ -906,7 +906,7 @@ bool CItemSheet::canExchangeOrGive(bool botChatGift) const } // *************************************************************************** -void CItemSheet::getItemPartListAsText(ucstring &ipList) const +void CItemSheet::getItemPartListAsText(std::string &ipList) const { bool all= true; for(uint i=0;i string sys; - sys = "Language "+CI18N::getCurrentLanguageName().toString() +" "; + sys = "Language "+CI18N::getCurrentLanguageName() +" "; if (!args.empty()) { @@ -1306,9 +1306,9 @@ NLMISC_COMMAND(execScript, "Execute a script file (.cmd)","") inComment++; if(inComment<=0) { - ucstring ucline(line); + string ucline(line); CInterfaceManager::parseTokens(ucline); - ICommand::execute(ucline.toUtf8(), g_log); + ICommand::execute(ucline, g_log); } if(strncmp(line, "*/", 2)==0) inComment--; diff --git a/ryzom/client/src/connection.cpp b/ryzom/client/src/connection.cpp index 238b11331..e31d7df51 100644 --- a/ryzom/client/src/connection.cpp +++ b/ryzom/client/src/connection.cpp @@ -1019,7 +1019,7 @@ TInterfaceState globalMenu() // Display the firewall alert string CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:outgame:connecting:title")); if (pVT != NULL) - pVT->setText(CI18N::get("uiFirewallAlert").toUtf8() + "..."); + pVT->setText(CI18N::get("uiFirewallAlert") + "..."); // The mouse and fullscreen mode should be unlocked for the user to set the firewall permission nlSleep( 30 ); // 'nice' the client, and prevent to make too many send attempts @@ -1235,8 +1235,8 @@ TInterfaceState globalMenu() if (pVT != NULL) { pVT->setMultiLine( true ); - pVT->setText(CI18N::get("uiFirewallFail").toUtf8()+".\n"+ - CI18N::get("uiFirewallAlert").toUtf8()+"."); + pVT->setText(CI18N::get("uiFirewallFail")+".\n"+ + CI18N::get("uiFirewallAlert")+"."); } } } @@ -1317,7 +1317,7 @@ public: if (pVT == NULL) return; if (rCS.Name.empty()) - pVT->setText(CI18N::get("uiEmptySlot").toUtf8()); + pVT->setText(CI18N::get("uiEmptySlot")); else pVT->setText(rCS.Name.toUtf8()); } @@ -1326,7 +1326,7 @@ public: { CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sPath+":text"+NLMISC::toString(i))); if (pVT == NULL) return; - pVT->setText(CI18N::get("uiEmptySlot").toUtf8()); + pVT->setText(CI18N::get("uiEmptySlot")); } } }; @@ -1348,7 +1348,7 @@ void setTarget(CCtrlBase *ctrl, const string &targetName, ucstring &value) if (ig) { CInterfaceExprValue exprValue; - exprValue.setUCString(value); + exprValue.setString(value.toUtf8()); CInterfaceLink::splitLinkTargets(targetName, ig, targets); for(uint k = 0; k < targets.size(); ++k) @@ -2315,7 +2315,7 @@ public: CCtrlBase *pBut = pNewLine->getCtrl("but"); if (pBut != NULL) { - pBut->setDefaultContextHelp(tooltip); + pBut->setDefaultContextHelp(tooltip.toUtf8()); } addGroupInList(pNewLine); } @@ -2680,7 +2680,7 @@ class CAHScenarioControl : public IActionHandler CViewText* viewText = dynamic_cast(result); if(viewText) { - viewText->setText(R2::getEditor().isInitialized()?CI18N::get("uiR2EDScenarioName").toUtf8():CI18N::get("uiR2EDScenarioFileName").toUtf8()); + viewText->setText(R2::getEditor().isInitialized()?CI18N::get("uiR2EDScenarioName"):CI18N::get("uiR2EDScenarioFileName")); } } @@ -2692,9 +2692,9 @@ class CAHScenarioControl : public IActionHandler if(okButton) { if(R2::getEditor().getAccessMode()!=R2::CEditor::AccessDM) - okButton->setHardText(CI18N::get("uiR2EDLaunchScenario").toString()); + okButton->setHardText(CI18N::get("uiR2EDLaunchScenario")); else - okButton->setHardText(CI18N::get("uiR2EDApplyScenarioFilters").toString()); + okButton->setHardText(CI18N::get("uiR2EDApplyScenarioFilters")); } } @@ -3182,9 +3182,9 @@ class CAHLoadScenario : public IActionHandler // -------------------------- TRuleType ruleType(TRuleType::rt_strict); - if(rules==CI18N::get("uiR2EDliberal").toString()) + if(rules==CI18N::get("uiR2EDliberal")) ruleType = TRuleType(TRuleType::rt_liberal); - else if(rules == CI18N::get("uiR2EDstrict").toString()) + else if(rules == CI18N::get("uiR2EDstrict")) ruleType = TRuleType(TRuleType::rt_strict); volatile static bool override = false; if (override) @@ -3248,7 +3248,7 @@ class CAHLoadScenario : public IActionHandler { CViewText* pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text")); if (pVT != NULL) - pVT->setText(CI18N::get("uiRingWarningFreeTrial").toUtf8()); + pVT->setText(CI18N::get("uiRingWarningFreeTrial")); CAHManager::getInstance()->runActionHandler("enter_modal", pCaller, "group=ui:interface:warning_free_trial"); return; @@ -3329,7 +3329,7 @@ class CAHLoadScenario : public IActionHandler { CViewText* pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text")); if (pVT != NULL) - pVT->setText(CI18N::get("uiRingWarningFreeTrial").toUtf8()); + pVT->setText(CI18N::get("uiRingWarningFreeTrial")); CAHManager::getInstance()->runActionHandler("enter_modal", pCaller, "group=ui:interface:warning_free_trial"); } @@ -3358,7 +3358,7 @@ class CAHLoadScenario : public IActionHandler { CViewText* pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text")); if (pVT != NULL) - pVT->setText(CI18N::get("uiRingWarningInviteFreeTrial").toUtf8()); + pVT->setText(CI18N::get("uiRingWarningInviteFreeTrial")); CAHManager::getInstance()->runActionHandler("enter_modal", pCaller, "group=ui:interface:warning_free_trial"); } } diff --git a/ryzom/client/src/contextual_cursor.cpp b/ryzom/client/src/contextual_cursor.cpp index 15dd6a17a..11398f620 100644 --- a/ryzom/client/src/contextual_cursor.cpp +++ b/ryzom/client/src/contextual_cursor.cpp @@ -162,7 +162,7 @@ bool CContextualCursor::context(const std::string &contextName, float dist, cons if(cursName.empty()) cursor->setString(CI18N::get(functions.cursor)); else - cursor->setString(cursName); + cursor->setString(cursName.toUtf8()); } } } diff --git a/ryzom/client/src/debug_client.cpp b/ryzom/client/src/debug_client.cpp index dd182f3c9..30e2645bf 100644 --- a/ryzom/client/src/debug_client.cpp +++ b/ryzom/client/src/debug_client.cpp @@ -529,7 +529,7 @@ string getDebugInformation() str += toString("ServerTick: %u\n", NetMngr.getCurrentServerTick()); str += toString("ConnectState: %s\n", NetMngr.getConnectionStateCStr()); str += toString("LocalAddress: %s\n", NetMngr.getAddress().asString().c_str()); - str += toString("Language: %s\n", CI18N::getCurrentLanguageName().toString().c_str()); + str += toString("Language: %s\n", CI18N::getCurrentLanguageName().c_str()); str += toString("ClientVersion: %s\n", getDebugVersion().c_str()); if (ClientCfg.R2Mode) { diff --git a/ryzom/client/src/init.cpp b/ryzom/client/src/init.cpp index 2e7469b4b..1c0ca9d30 100644 --- a/ryzom/client/src/init.cpp +++ b/ryzom/client/src/init.cpp @@ -578,7 +578,7 @@ void checkDriverDepth () #else if (mode.Depth != 16 && mode.Depth != 24 && mode.Depth != 32) #endif - ExitClientError (CI18N::get ("uiDesktopNotIn32").toUtf8().c_str ()); + ExitClientError (CI18N::get ("uiDesktopNotIn32").c_str ()); } } @@ -1060,7 +1060,7 @@ void prelogInit() if(Driver == NULL) { - ExitClientError (CI18N::get ("Can_t_load_the_display_driver").toUtf8().c_str ()); + ExitClientError (CI18N::get ("Can_t_load_the_display_driver").c_str ()); // ExitClientError() call exit() so the code after is never called return; } @@ -1151,14 +1151,14 @@ void prelogInit() string msg; if (mode.Windowed) { - msg = CI18N::get ("can_t_create_a_window_display").toUtf8(); + msg = CI18N::get ("can_t_create_a_window_display"); } else { - msg = CI18N::get ("can_t_create_a_fullscreen_display").toUtf8(); + msg = CI18N::get ("can_t_create_a_fullscreen_display"); } msg += " (%dx%d %d "; - msg += CI18N::get ("bits").toUtf8 (); + msg += CI18N::get ("bits"); msg += ")"; ExitClientError (msg.c_str (), mode.Width, mode.Height, mode.Depth); // ExitClientError() call exit() so the code after is never called diff --git a/ryzom/client/src/init_main_loop.cpp b/ryzom/client/src/init_main_loop.cpp index 4108c4059..ee88966e7 100644 --- a/ryzom/client/src/init_main_loop.cpp +++ b/ryzom/client/src/init_main_loop.cpp @@ -1714,6 +1714,6 @@ void initBloomConfigUI() else { if(group) - group->setDefaultContextHelp(ucstring("")); + group->setDefaultContextHelp(std::string()); } } diff --git a/ryzom/client/src/interface_v3/action_handler_edit.cpp b/ryzom/client/src/interface_v3/action_handler_edit.cpp index bde8f5389..c2d3bafbc 100644 --- a/ryzom/client/src/interface_v3/action_handler_edit.cpp +++ b/ryzom/client/src/interface_v3/action_handler_edit.cpp @@ -70,7 +70,7 @@ static inline uint getCharacterCategory(u32char c) /** skip a block of character in a string, (same behaviour than when Ctrl-arrow is pressed) * It returns the new index */ -static uint skipUCCharsRight(uint startPos, const u32string &str) +static uint skipUCCharsRight(uint startPos, const ::u32string &str) { uint pos = startPos; uint endIndex = (uint)str.length(); @@ -87,7 +87,7 @@ static uint skipUCCharsRight(uint startPos, const u32string &str) /** skip a block of character in a string, (same behaviour than when Ctrl-arrow is pressed) * It returns the new index */ -static uint skipUCCharsLeft(uint startPos, const u32string &str) +static uint skipUCCharsLeft(uint startPos, const ::u32string &str) { uint pos = startPos; -- pos; @@ -363,7 +363,7 @@ class CAHEditPreviousLine : public CAHEdit if (_GroupEdit->getMaxHistoric() && (! _GroupEdit->getViewText()->getMultiLine())) { // Get the start of the string. - u32string startStr= _GroupEdit->getInputStringRef().substr(0, _GroupEdit->getCursorPos()); + ::u32string startStr= _GroupEdit->getInputStringRef().substr(0, _GroupEdit->getCursorPos()); // Search all historic string that match startStr. for(sint i=_GroupEdit->getCurrentHistoricIndex()+1;i<(sint)_GroupEdit->getNumHistoric();i++) @@ -435,7 +435,7 @@ class CAHEditNextLine : public CAHEdit if( (! _GroupEdit->getViewText()->getMultiLine()) && _GroupEdit->getMaxHistoric() && _GroupEdit->getCurrentHistoricIndex()>0) { // Get the start of the string. - u32string startStr= _GroupEdit->getInputStringRef().substr(0, _GroupEdit->getCursorPos()); + ::u32string startStr= _GroupEdit->getInputStringRef().substr(0, _GroupEdit->getCursorPos()); // Search all historic string that match startStr. for(sint i=_GroupEdit->getCurrentHistoricIndex()-1;i>=0;i--) @@ -521,8 +521,8 @@ protected: // else cut forwards else if(_GroupEdit->getCursorPos() < (sint32) _GroupEdit->getInputStringRef().length()) { - u32string inputString = _GroupEdit->getInputStringRef(); - u32string::iterator it = inputString.begin() + _GroupEdit->getCursorPos(); + ::u32string inputString = _GroupEdit->getInputStringRef(); + ::u32string::iterator it = inputString.begin() + _GroupEdit->getCursorPos(); inputString.erase(it); _GroupEdit->setInputStringRef (inputString); if (!_GroupEdit->getAHOnChange().empty()) @@ -660,7 +660,7 @@ class CAHEditExpandOrCycleTell : public CAHEdit else { // it is not a filtered chat, display 'tell' (must be ingame) - _GroupEdit->setCommand(ucstring("tell ") + *lastTellPeople + (ucchar) ' ', false); + _GroupEdit->setCommand("tell " + (*lastTellPeople).toUtf8() + ' ', false); } } }; diff --git a/ryzom/client/src/interface_v3/action_handler_game.cpp b/ryzom/client/src/interface_v3/action_handler_game.cpp index 07180919d..41384910b 100644 --- a/ryzom/client/src/interface_v3/action_handler_game.cpp +++ b/ryzom/client/src/interface_v3/action_handler_game.cpp @@ -2071,9 +2071,9 @@ class CActionHandlerSetTargetName : public IActionHandler } // Set to target CInterfaceExprValue evUCStr; - evUCStr.setUCString(TargetName); + evUCStr.setString(TargetName.toUtf8()); CInterfaceLink::setTargetProperty(sNameTarget, evUCStr); - evUCStr.setUCString(TargetTitle); + evUCStr.setString(TargetTitle.toUtf8()); CInterfaceLink::setTargetProperty(sTitleTarget, evUCStr); } } @@ -2113,7 +2113,7 @@ class CActionHandlerSetTargetForceRegionLevel: public IActionHandler pVBR->setColor(CRGBA(0,0,0,0)); if (pTooltip) - pTooltip->setDefaultContextHelp(ucstring("")); + pTooltip->setDefaultContextHelp(std::string()); return; } @@ -2166,7 +2166,7 @@ class CActionHandlerSetTargetForceRegionLevel: public IActionHandler pVBR->setColor(CRGBA(0,0,0,0)); if (pTooltip) - pTooltip->setDefaultContextHelp(ucstring("")); + pTooltip->setDefaultContextHelp(std::string()); return; } @@ -2191,7 +2191,7 @@ class CActionHandlerSetTargetForceRegionLevel: public IActionHandler CCtrlBase *tooltip = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:target:header_opened:force")); if (tooltip) { - ucstring str; + string str; if (nForceRegion == 1) nForceRegion = 2; @@ -3091,10 +3091,10 @@ public: if( pCB ) { pCB->resetTexts(); - pCB->addText(CI18N::get("uigcLowTextureMode").toUtf8()); - pCB->addText(CI18N::get("uigcNormalTextureMode").toUtf8()); + pCB->addText(CI18N::get("uigcLowTextureMode")); + pCB->addText(CI18N::get("uigcNormalTextureMode")); if(ClientCfg.HDTextureInstalled) - pCB->addText(CI18N::get("uigcHighTextureMode").toUtf8()); + pCB->addText(CI18N::get("uigcHighTextureMode")); } // Anisotropic Filtering @@ -3107,7 +3107,7 @@ public: sint maxAnisotropic = (sint)Driver->getAnisotropicFilterMaximum(); pCB->resetTexts(); - pCB->addText(CI18N::get("uigcFxAnisotropicFilterNone").toUtf8()); + pCB->addText(CI18N::get("uigcFxAnisotropicFilterNone")); sint anisotropic = 2; uint i = 1; @@ -4047,7 +4047,7 @@ public: ucstring str; fillPlayerBarText(str, "HP", SCORES::hit_points, "uittPlayerLifeFormat"); - CWidgetManager::getInstance()->setContextHelpText(str); + CWidgetManager::getInstance()->setContextHelpText(str.toUtf8()); } }; REGISTER_ACTION_HANDLER(CHandlerPlayerTTLife, "player_tt_life"); @@ -4064,7 +4064,7 @@ public: ucstring str; fillPlayerBarText(str, "STA", SCORES::stamina, "uittPlayerStaminaFormat"); - CWidgetManager::getInstance()->setContextHelpText(str); + CWidgetManager::getInstance()->setContextHelpText(str.toUtf8()); } }; REGISTER_ACTION_HANDLER(CHandlerPlayerTTStamina, "player_tt_stamina"); @@ -4081,7 +4081,7 @@ public: ucstring str; fillPlayerBarText(str, "SAP", SCORES::sap, "uittPlayerSapFormat"); - CWidgetManager::getInstance()->setContextHelpText(str); + CWidgetManager::getInstance()->setContextHelpText(str.toUtf8()); } }; REGISTER_ACTION_HANDLER(CHandlerPlayerTTSap, "player_tt_sap"); @@ -4098,7 +4098,7 @@ public: ucstring str; fillPlayerBarText(str, "FOCUS", SCORES::focus, "uittPlayerFocusFormat"); - CWidgetManager::getInstance()->setContextHelpText(str); + CWidgetManager::getInstance()->setContextHelpText(str.toUtf8()); } }; REGISTER_ACTION_HANDLER(CHandlerPlayerTTFocus, "player_tt_focus"); @@ -4128,7 +4128,7 @@ public: ucstring str= CI18N::get("uittBulkFormat"); strFindReplace(str, "%v", toString("%.2f", val) ); strFindReplace(str, "%m", toString(maxVal) ); - CWidgetManager::getInstance()->setContextHelpText(str); + CWidgetManager::getInstance()->setContextHelpText(str.toUtf8()); } }; REGISTER_ACTION_HANDLER(CHandlerGetTTBulk, "get_tt_bulk"); diff --git a/ryzom/client/src/interface_v3/action_handler_help.cpp b/ryzom/client/src/interface_v3/action_handler_help.cpp index 6b699f8ee..0eb240b7d 100644 --- a/ryzom/client/src/interface_v3/action_handler_help.cpp +++ b/ryzom/client/src/interface_v3/action_handler_help.cpp @@ -992,9 +992,7 @@ class CHandlerBrowse : public IActionHandler } } - ucstring ucparams(params); - CInterfaceManager::parseTokens(ucparams); - params = ucparams.toUtf8(); + CInterfaceManager::parseTokens(params); // go. NB: the action handler himself may translate params from utf8 CAHManager::getInstance()->runActionHandler(action, elementGroup, params); @@ -2014,7 +2012,7 @@ void getItemText (CDBCtrlSheet *item, ucstring &itemText, const CItemSheet*pIS) if(pIS->canBuildSomeItemPart()) { ucstring fmt= CI18N::get("uihelpItemMPCraft"); - ucstring ipList; + std::string ipList; pIS->getItemPartListAsText(ipList); strFindReplace(fmt, "%ip", ipList); strFindReplace(itemText, "%craft", fmt); @@ -2200,7 +2198,7 @@ static void setupRawMaterialStats(CSheetHelpSetup &setup) if(pIS->canBuildItemPart(faberType)) { - pCB->addText(RM_FABER_TYPE::toLocalString(faberType).toUtf8()); + pCB->addText(RM_FABER_TYPE::toLocalString(faberType)); } } @@ -3165,7 +3163,7 @@ void setupListBrickHeader(CSheetHelpSetup &setup) if(view) { view->setActive(true); - view->setTextFormatTaged(CI18N::get("uihelpPhraseHeaderBricks").toUtf8()); + view->setTextFormatTaged(CI18N::get("uihelpPhraseHeaderBricks")); } } @@ -3473,7 +3471,7 @@ void setConsoModSuccessTooltip( CDBCtrlSheet *cs ) CInterfaceManager * pIM = CInterfaceManager::getInstance(); CCDBNodeLeaf * nodeSM = NULL; - ucstring ustr; + string ustr; if( CSheetId(cs->getSheetId()).toString() == "mod_melee_success.sbrick" ) { ustr = CI18N::get("uittModMeleeSuccess"); @@ -3588,7 +3586,7 @@ public: CCDBNodeLeaf * node = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:USER:DEATH_XP_MALUS", false); if( node ) { - ucstring txt = CI18N::get("uittDeathPenalty"); + string txt = CI18N::get("uittDeathPenalty"); strFindReplace(txt, "%dp", toString((100*node->getValue16())/254)); CWidgetManager::getInstance()->setContextHelpText(txt); } @@ -3597,7 +3595,7 @@ public: else if( getAuraDisabledState(cs) ) { // get the normal string, and append a short info. - ucstring str; + std::string str; cs->getContextHelp(str); str+= CI18N::get("uittAuraDisabled"); @@ -3630,7 +3628,7 @@ public: CCDBNodeLeaf *node = NLGUI::CDBManager::getInstance()->getDbProp(toString("SERVER:PACK_ANIMAL:BEAST%d:NAME", index)); if (node && CStringManagerClient::instance()->getDynString(node->getValue32(), txt)) { - CWidgetManager::getInstance()->setContextHelpText(CEntityCL::removeTitleFromName(txt)); + CWidgetManager::getInstance()->setContextHelpText(CEntityCL::removeTitleFromName(txt).toUtf8()); } } }; @@ -3676,7 +3674,7 @@ public: str += toString(minTimeRemaining); // replace the context help that is required. - CWidgetManager::getInstance()->setContextHelpText(str); + CWidgetManager::getInstance()->setContextHelpText(str.toUtf8()); } }; REGISTER_ACTION_HANDLER( CHandlerAnimalDeadPopupTooltip, "animal_dead_popup_tooltip"); @@ -3838,7 +3836,7 @@ static void onMpChangeItemPart(CInterfaceGroup *wnd, uint32 itemSheetId, const s CViewText *statTitle= dynamic_cast(groupStat->getElement(groupStat->getId()+":text" )); CDBViewBar *statValue= dynamic_cast(groupStat->getElement(groupStat->getId()+":bar" )); if(statTitle) - statTitle->setText(RM_FABER_STAT_TYPE::toLocalString(statType).toUtf8()); + statTitle->setText(RM_FABER_STAT_TYPE::toLocalString(statType)); if(statValue) statValue->setValue(itemPart.Stats[i]); } diff --git a/ryzom/client/src/interface_v3/action_handler_item.cpp b/ryzom/client/src/interface_v3/action_handler_item.cpp index 2d6a7e6f5..23992f4f6 100644 --- a/ryzom/client/src/interface_v3/action_handler_item.cpp +++ b/ryzom/client/src/interface_v3/action_handler_item.cpp @@ -2046,9 +2046,7 @@ class CHandlerItemMenuCheck : public IActionHandler std::string name = groupNames[i]; std::string ahParams = "name=" + name; //Use ucstring because group name can contain accentued characters (and stuff like that) - ucstring nameUC; - nameUC.fromUtf8(name); - pGroupMenu->addLine(nameUC, "", "", name); + pGroupMenu->addLine(name, "", "", name); CGroupSubMenu* pNewSubMenu = new CGroupSubMenu(CViewBase::TCtorParam()); pGroupMenu->setSubMenu(pGroupMenu->getNumLine()-1, pNewSubMenu); if(pNewSubMenu) @@ -2074,7 +2072,7 @@ class CHandlerItemMenuCheck : public IActionHandler { //there is an offset of 1 because TInventory names are pet_animal1/2/3/4 std::string dst = toString("destination=pet_animal%d|", j + 1); - CViewTextMenu* tmp = pNewSubMenu->addLine(ucstring(pMoveToPa[j]->getHardText()),"item_group_move", dst + ahParams, name + toString("_pa%d", j + 1)); + CViewTextMenu* tmp = pNewSubMenu->addLine(pMoveToPa[j]->getHardText(),"item_group_move", dst + ahParams, name + toString("_pa%d", j + 1)); if(tmp) tmp->setGrayed(pMoveToPa[j]->getGrayed()); } } diff --git a/ryzom/client/src/interface_v3/action_handler_phrase.cpp b/ryzom/client/src/interface_v3/action_handler_phrase.cpp index dcc55f9ea..f55d376bd 100644 --- a/ryzom/client/src/interface_v3/action_handler_phrase.cpp +++ b/ryzom/client/src/interface_v3/action_handler_phrase.cpp @@ -1668,7 +1668,7 @@ static DECLARE_INTERFACE_USER_FCT(getSPhraseName) return false; sint sphraseId= (sint)args[0].getInteger(); CSPhraseManager *pPM= CSPhraseManager::getInstance(); - result.setUCString(pPM->getPhrase(sphraseId).Name); + result.setString(pPM->getPhrase(sphraseId).Name.toUtf8()); return true; } else @@ -1699,7 +1699,7 @@ public: else strFindReplace(str, "%comp", CI18N::get("uittPhraseCombatRestrictOK")); - CWidgetManager::getInstance()->setContextHelpText(str); + CWidgetManager::getInstance()->setContextHelpText(str.toUtf8()); } }; REGISTER_ACTION_HANDLER( CHandlerCombatRestrictTooltip, "phrase_combat_restrict_tooltip"); diff --git a/ryzom/client/src/interface_v3/action_phrase_faber.cpp b/ryzom/client/src/interface_v3/action_phrase_faber.cpp index fcef685c5..6591472d4 100644 --- a/ryzom/client/src/interface_v3/action_phrase_faber.cpp +++ b/ryzom/client/src/interface_v3/action_phrase_faber.cpp @@ -1790,7 +1790,7 @@ void CActionPhraseFaber::updateItemResult() uint sv= uint(statArray[i]*100); if(statTitle) { - statTitle->setText(RM_FABER_STAT_TYPE::toLocalString(statType).toUtf8()); + statTitle->setText(RM_FABER_STAT_TYPE::toLocalString(statType)); statTitle->setColor(usageColor); } if(statValueBar) @@ -1812,7 +1812,7 @@ void CActionPhraseFaber::updateItemResult() RM_FABER_STAT_TYPE::isMagicProtectStat(RM_FABER_STAT_TYPE::TRMStatType(i)) ) statToolTip->setDefaultContextHelp(CI18N::get("uiFaberStatActive")); else - statToolTip->setDefaultContextHelp(ucstring()); + statToolTip->setDefaultContextHelp(std::string()); } else statToolTip->setDefaultContextHelp(CI18N::get("uiFaberStatGrayed")); diff --git a/ryzom/client/src/interface_v3/bot_chat_page_dynamic_mission.cpp b/ryzom/client/src/interface_v3/bot_chat_page_dynamic_mission.cpp index 0fc03124a..e5f8cf1e4 100644 --- a/ryzom/client/src/interface_v3/bot_chat_page_dynamic_mission.cpp +++ b/ryzom/client/src/interface_v3/bot_chat_page_dynamic_mission.cpp @@ -189,7 +189,7 @@ void CBotChatPageDynamicMission::update() else { // add a text to show the player that the text is being received - _ChoiceCB[k]->addText(NLMISC::CI18N::get("uiWaitingChoiceFromServer").toUtf8()); + _ChoiceCB[k]->addText(NLMISC::CI18N::get("uiWaitingChoiceFromServer")); } } } diff --git a/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp b/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp index 352ff65f4..4c67b70b3 100644 --- a/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp +++ b/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp @@ -865,7 +865,7 @@ void CBotChatPageTrade::startBuyDialog(CDBCtrlSheet *sheet, CCtrlBase * /* pCall CViewText *priceLabel = dynamic_cast(ig->getView( "standard_price:total_price_header" )); if ( _BuyMean == Money && priceLabel ) { - priceLabel->setText( CI18N::get( "uiPrice" ).toUtf8() ); + priceLabel->setText( CI18N::get( "uiPrice" ) ); priceLabel->setActive(true); } else @@ -893,7 +893,7 @@ void CBotChatPageTrade::startBuyDialog(CDBCtrlSheet *sheet, CCtrlBase * /* pCall { confirmButton->setActive( true ); // no need any context help because too simple - confirmButton->setDefaultContextHelp(ucstring()); + confirmButton->setDefaultContextHelp(std::string()); if(isItem) { CItemSheet * itemSheet = dynamic_cast ( SheetMngr.get( CSheetId( sheet->getSheetId() ) ) ); @@ -977,7 +977,7 @@ void CBotChatPageTrade::startSellDialog(CDBCtrlSheet *sheet, CCtrlBase * /* pCal CViewText *priceLabel = dynamic_cast(ig->getView( "standard_price:total_price_header" )); if ( priceLabel ) { - priceLabel->setText( CI18N::get( "uiImmediatePrice" ).toUtf8() ); + priceLabel->setText( CI18N::get( "uiImmediatePrice" ) ); priceLabel->setActive(true); } @@ -2428,7 +2428,7 @@ public: void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */) { // \todo yoyo: for now disable tooltip - CWidgetManager::getInstance()->setContextHelpText(ucstring()); + CWidgetManager::getInstance()->setContextHelpText(std::string()); } }; REGISTER_ACTION_HANDLER(CHandlerBotChatTTItemType, "botchat_tt_item_type"); @@ -2575,11 +2575,11 @@ static DECLARE_INTERFACE_USER_FCT(getPriceWithFame) sint value= (sint)args[0].getInteger(); sint valueFame= (sint)args[1].getInteger(); if(value==-1) - result.setUCString(CI18N::get("uiBadPrice")); + result.setString(CI18N::get("uiBadPrice")); else if(value==valueFame) - result.setUCString(NLMISC::formatThousands(toString(value))); + result.setString(NLMISC::formatThousands(toString(value))); else - result.setUCString(NLMISC::formatThousands(toString(valueFame)) + " (" + NLMISC::formatThousands(toString(value)) + ")"); + result.setString(NLMISC::formatThousands(toString(valueFame)) + " (" + NLMISC::formatThousands(toString(value)) + ")"); return true; } @@ -2595,7 +2595,7 @@ static DECLARE_INTERFACE_USER_FCT(getBonusOnResale) sint valueHigh= (sint)args[0].getInteger(); sint valueLow= (sint)args[1].getInteger(); sint diff = valueHigh - valueLow; - result.setUCString("+" + NLMISC::formatThousands(toString(diff))); + result.setString("+" + NLMISC::formatThousands(toString(diff))); return true; } diff --git a/ryzom/client/src/interface_v3/chat_window.cpp b/ryzom/client/src/interface_v3/chat_window.cpp index 72a877cb7..e046fbe2d 100644 --- a/ryzom/client/src/interface_v3/chat_window.cpp +++ b/ryzom/client/src/interface_v3/chat_window.cpp @@ -349,13 +349,13 @@ void CChatWindow::enableBlink(uint numBlinks) void CChatWindow::setCommand(const std::string &command, bool execute) { if (!_EB) return; - _EB->setCommand(ucstring(command), execute); + _EB->setCommand(command, execute); } void CChatWindow::setCommand(const ucstring &command,bool execute) { if (!_EB) return; - _EB->setCommand(command, execute); + _EB->setCommand(command.toUtf8(), execute); } @@ -472,25 +472,25 @@ void CChatWindow::setHeaderColor(const std::string &n) //================================================================================= void CChatWindow::displayLocalPlayerTell(const ucstring &receiver, const ucstring &msg, uint numBlinks /*= 0*/) { - ucstring finalMsg; + string finalMsg; CInterfaceProperty prop; prop.readRGBA("UI:SAVE:CHAT:COLORS:SPEAKER"," "); encodeColorTag(prop.getRGBA(), finalMsg, false); - ucstring csr(CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : ""); + string csr(CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : ""); finalMsg += csr + CI18N::get("youTell") + ": "; prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," "); encodeColorTag(prop.getRGBA(), finalMsg, true); - finalMsg += msg; + finalMsg += msg.toUtf8(); - ucstring s = CI18N::get("youTellPlayer"); - strFindReplace(s, "%name", receiver); + string s = CI18N::get("youTellPlayer"); + strFindReplace(s, "%name", receiver.toUtf8()); strFindReplace(finalMsg, CI18N::get("youTell"), s); displayMessage(finalMsg, prop.getRGBA(), CChatGroup::tell, 0, numBlinks); CInterfaceManager::getInstance()->log(finalMsg, CChatGroup::groupTypeToString(CChatGroup::tell)); } -void CChatWindow::encodeColorTag(const NLMISC::CRGBA &color, ucstring &text, bool append) +void CChatWindow::encodeColorTag(const NLMISC::CRGBA &color, std::string &text, bool append) { // WARNING : The lookup table MUST contains 17 element (with the last doubled) // because we add 7 to the 8 bit color before shifting to right in order to match color @@ -498,8 +498,8 @@ void CChatWindow::encodeColorTag(const NLMISC::CRGBA &color, ucstring &text, boo // Have 17 entry remove the need for a %16 for each color component. // By the way, this comment is more longer to type than to add the %16... // - static ucchar ConvTable[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'F'}; - ucstring str; + static char ConvTable[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'F'}; + string str; if (append) { str.reserve(7 + str.size()); @@ -1273,7 +1273,7 @@ public: { CGroupEditBox *pEB = dynamic_cast(pCaller); if (pEB == NULL) return; - ucstring text = pEB->getInputStringAsUtf16(); + string text = pEB->getInputString(); // If the line is empty, do nothing if(text.empty()) return; @@ -1297,7 +1297,7 @@ public: if(text[0] == '/') { CChatWindow::_ChatWindowLaunchingCommand = chat; - string str = text.toUtf8(); + string str = text; string cmdWithArgs = str.substr(1); // Get the command name from the string, can contain spaces diff --git a/ryzom/client/src/interface_v3/chat_window.h b/ryzom/client/src/interface_v3/chat_window.h index 278824753..0c8811842 100644 --- a/ryzom/client/src/interface_v3/chat_window.h +++ b/ryzom/client/src/interface_v3/chat_window.h @@ -156,7 +156,7 @@ public: void displayLocalPlayerTell(const ucstring &receiver, const ucstring &msg, uint numBlinks = 0); /// Encode a color tag '@{RGBA}' in the text. If append is true, append at end of text, otherwise, replace the text - static void encodeColorTag(const NLMISC::CRGBA &color, ucstring &text, bool append=true); + static void encodeColorTag(const NLMISC::CRGBA &color, std::string &text, bool append=true); /////////////////////////////////////////////////////////////////////////////////////// protected: diff --git a/ryzom/client/src/interface_v3/dbctrl_sheet.cpp b/ryzom/client/src/interface_v3/dbctrl_sheet.cpp index a6084fdbe..d0297db35 100644 --- a/ryzom/client/src/interface_v3/dbctrl_sheet.cpp +++ b/ryzom/client/src/interface_v3/dbctrl_sheet.cpp @@ -3373,13 +3373,13 @@ void CDBCtrlSheet::setupItemInfoWaiter() } // *************************************************************************** -void CDBCtrlSheet::getContextHelp(ucstring &help) const +void CDBCtrlSheet::getContextHelp(std::string &help) const { if (getType() == CCtrlSheetInfo::SheetType_Skill) { // just show the name of the skill // the sheet id is interpreted as a skill enum - help= STRING_MANAGER::CStringManagerClient::getSkillLocalizedName( (SKILLS::ESkills)_SheetId.getSInt32() ); + help= CUtfStringView(STRING_MANAGER::CStringManagerClient::getSkillLocalizedName( (SKILLS::ESkills)_SheetId.getSInt32() )).toUtf8(); } else if(getType() == CCtrlSheetInfo::SheetType_Macro) { @@ -3392,7 +3392,7 @@ void CDBCtrlSheet::getContextHelp(ucstring &help) const if (macroName.empty()) macroName = CI18N::get("uiNotAssigned"); - ucstring assignedTo = macro->Combo.toUCString(); + ucstring assignedTo = macro->Combo.toString(); if (assignedTo.empty()) assignedTo = CI18N::get("uiNotAssigned"); @@ -3426,7 +3426,7 @@ void CDBCtrlSheet::getContextHelp(ucstring &help) const strFindReplace(dispText, ucstring("%n"), macroName); strFindReplace(dispText, ucstring("%k"), assignedTo); strFindReplace(dispText, ucstring("%c"), dispCommands); - help = dispText; + help = dispText.toUtf8(); } else if(getType() == CCtrlSheetInfo::SheetType_Item) { @@ -3437,10 +3437,10 @@ void CDBCtrlSheet::getContextHelp(ucstring &help) const { // call lua function to update tooltip window _ItemInfoWaiter.sendRequest(); - help = _ItemInfoWaiter.infoValidated(); + help = _ItemInfoWaiter.infoValidated().toUtf8(); // its expected to get at least item name back if (help.empty()) - help = getItemActualName(); + help = getItemActualName().toUtf8(); } else if (!_ContextHelp.empty()) { @@ -3448,7 +3448,7 @@ void CDBCtrlSheet::getContextHelp(ucstring &help) const } else { - help = getItemActualName(); + help = getItemActualName().toUtf8();; } } else @@ -3479,7 +3479,7 @@ void CDBCtrlSheet::getContextHelp(ucstring &help) const CSBrickManager *pBM= CSBrickManager::getInstance(); CSBrickSheet *brick= pBM->getBrick(CSheetId(getSheetId())); if(brick) - help= STRING_MANAGER::CStringManagerClient::getSBrickLocalizedName(brick->Id); + help= CUtfStringView(STRING_MANAGER::CStringManagerClient::getSBrickLocalizedName(brick->Id)).toUtf8(); else help= _ContextHelp; } @@ -3488,7 +3488,7 @@ void CDBCtrlSheet::getContextHelp(ucstring &help) const sint32 phraseId= getSheetId(); if (phraseId == 0) { - help = ucstring(); + help = std::string(); } else { @@ -3506,10 +3506,11 @@ void CDBCtrlSheet::getContextHelp(ucstring &help) const game = game["game"]; game.callMethodByNameNoThrow("updatePhraseTooltip", 1, 1); // retrieve result from stack - help = ucstring(); + ucstring tmpHelp; if (!ls->empty()) { - CLuaIHM::pop(*ls, help); + CLuaIHM::pop(*ls, tmpHelp); // FIXME: Lua UTF-8 + help = tmpHelp.toUtf8(); } else { @@ -3542,7 +3543,7 @@ void CDBCtrlSheet::getContextHelp(ucstring &help) const { CSPhraseSheet *phrase= dynamic_cast(SheetMngr.get(CSheetId(getSheetId()))); if(phrase) - help= STRING_MANAGER::CStringManagerClient::getSPhraseLocalizedName(phrase->Id); + help= CUtfStringView(STRING_MANAGER::CStringManagerClient::getSPhraseLocalizedName(phrase->Id)).toUtf8(); else help= _ContextHelp; } @@ -3550,14 +3551,14 @@ void CDBCtrlSheet::getContextHelp(ucstring &help) const { const COutpostBuildingSheet *outpost = asOutpostBuildingSheet(); if (outpost) - help = CStringManagerClient::getOutpostBuildingLocalizedName(CSheetId(_SheetId.getSInt32())); + help = CUtfStringView(CStringManagerClient::getOutpostBuildingLocalizedName(CSheetId(_SheetId.getSInt32()))).toUtf8(); else help = _ContextHelp; } } // *************************************************************************** -void CDBCtrlSheet::getContextHelpToolTip(ucstring &help) const +void CDBCtrlSheet::getContextHelpToolTip(std::string &help) const { // Special case for buff items and spell crystals, only for tooltips if (getType() == CCtrlSheetInfo::SheetType_Item) @@ -3568,7 +3569,7 @@ void CDBCtrlSheet::getContextHelpToolTip(ucstring &help) const if (useItemInfoForFamily(item->Family)) { _ItemInfoWaiter.sendRequest(); - help = _ItemInfoWaiter.infoValidated(); + help = _ItemInfoWaiter.infoValidated().toUtf8(); return; } } diff --git a/ryzom/client/src/interface_v3/dbctrl_sheet.h b/ryzom/client/src/interface_v3/dbctrl_sheet.h index e6ed7587b..b662d86af 100644 --- a/ryzom/client/src/interface_v3/dbctrl_sheet.h +++ b/ryzom/client/src/interface_v3/dbctrl_sheet.h @@ -393,9 +393,9 @@ public: NLMISC::CRGBA getSheetColor() const {return _SheetColor;} /// Special ContextHelp for ctrl sheet. - virtual void getContextHelp(ucstring &help) const; + virtual void getContextHelp(std::string &help) const; - virtual void getContextHelpToolTip(ucstring &help) const; + virtual void getContextHelpToolTip(std::string &help) const; /** true if an item of another ctrlSheet can be dropped on this slot. diff --git a/ryzom/client/src/interface_v3/dbgroup_build_phrase.cpp b/ryzom/client/src/interface_v3/dbgroup_build_phrase.cpp index c75dc3af3..5a1952735 100644 --- a/ryzom/client/src/interface_v3/dbgroup_build_phrase.cpp +++ b/ryzom/client/src/interface_v3/dbgroup_build_phrase.cpp @@ -1119,10 +1119,10 @@ void CDBGroupBuildPhrase::updateAllDisplay(const CSPhraseCom &phrase) { word.InfoView->setActive(true); if(i==0) - word.InfoView->setText( CI18N::get("uiTextHelpSelectRootBrick").toUtf8() ); + word.InfoView->setText( CI18N::get("uiTextHelpSelectRootBrick") ); else // start effect index at 1 (human readable :) ) - word.InfoView->setText( CI18N::get("uiTextHelpSelectEffectBrick").toUtf8() + toString(i) ); + word.InfoView->setText( CI18N::get("uiTextHelpSelectEffectBrick") + toString(i) ); } } diff --git a/ryzom/client/src/interface_v3/dbgroup_list_sheet_mission.cpp b/ryzom/client/src/interface_v3/dbgroup_list_sheet_mission.cpp index da46e9e7b..f008c32f1 100644 --- a/ryzom/client/src/interface_v3/dbgroup_list_sheet_mission.cpp +++ b/ryzom/client/src/interface_v3/dbgroup_list_sheet_mission.cpp @@ -56,7 +56,7 @@ CViewText *CDBGroupListSheetMission::CSheetChildMission::createViewText() const CViewTextIDFormated *vti = new CViewTextIDFormated(CViewBase::TCtorParam()); if (Ctrl) vti->setDBLeaf(dynamic_cast(Ctrl->getRootBranch()->getNode(ICDBNode::CTextId("TEXT")))); else vti->setDBLeaf(NULL); - vti->setFormatString(ucstring("$t")); + vti->setFormatString("$t"); return vti; } diff --git a/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp b/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp index 8483e9925..0a474b650 100644 --- a/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp +++ b/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp @@ -1051,7 +1051,7 @@ void CDBGroupListSheetText::CSheetChild::updateViewTextAsItem() if(Ctrl && Text && Ctrl->getSheetCategory() == CDBCtrlSheet::Item) { // get the text - ucstring text; + std::string text; Ctrl->getContextHelp(text); // Text color red if requirement not met @@ -1070,7 +1070,7 @@ void CDBGroupListSheetText::CSheetChild::updateViewTextAsItem() // Add craft info for MP if(pIS->Family==ITEMFAMILY::RAW_MATERIAL) { - ucstring ipList; + string ipList; pIS->getItemPartListAsText(ipList); if(ipList.empty()) { @@ -1086,7 +1086,7 @@ void CDBGroupListSheetText::CSheetChild::updateViewTextAsItem() } // set text - Text->setTextFormatTaged(text.toUtf8()); + Text->setTextFormatTaged(text); } } diff --git a/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.h b/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.h index d9a495635..3d308d582 100644 --- a/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.h +++ b/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.h @@ -133,9 +133,9 @@ public: // Called at updateCoords to remake the text virtual void updateViewText(CDBGroupListSheetText * /* pFather */) { - ucstring text; + std::string text; Ctrl->getContextHelp(text); - Text->setText(text.toUtf8()); + Text->setText(text); } // create a CViewText object that is displayed next to the item. This is the opportunnity to create diff --git a/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_phrase.cpp b/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_phrase.cpp index 3cdf24ca8..02f8fb6ae 100644 --- a/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_phrase.cpp +++ b/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_phrase.cpp @@ -77,7 +77,7 @@ void CDBGroupListSheetTextPhrase::CSheetChildPhrase::init(CDBGroupListSheetText // *************************************************************************** void CDBGroupListSheetTextPhrase::CSheetChildPhrase::updateViewText(CDBGroupListSheetText * /* pFather */) { - ucstring text; + std::string text; if(Ctrl->getType()!=CCtrlSheetInfo::SheetType_SPhrase) return; @@ -87,14 +87,14 @@ void CDBGroupListSheetTextPhrase::CSheetChildPhrase::updateViewText(CDBGroupList // append the level if possible if(LevelDB) { - ucstring fmt= CI18N::get("uiPhraseLevelFmt"); + std::string fmt= CI18N::get("uiPhraseLevelFmt").toUtf8(); strFindReplace(fmt, "%d", toString(LevelCache)); text+= "\n" + fmt; } #endif // set - Text->setText(text.toUtf8()); + Text->setText(text); } diff --git a/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_phrase_id.cpp b/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_phrase_id.cpp index 6e98afc5c..bc812bbc5 100644 --- a/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_phrase_id.cpp +++ b/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_phrase_id.cpp @@ -41,14 +41,14 @@ CDBGroupListSheetTextPhraseId::CSheetChildPhrase::CSheetChildPhrase() // *************************************************************************** void CDBGroupListSheetTextPhraseId::CSheetChildPhrase::updateViewText(CDBGroupListSheetText * /* pFather */) { - ucstring text; + std::string text; if(Ctrl->getType()!=CCtrlSheetInfo::SheetType_SPhraseId) return; // Get the User Name of the phrase Ctrl->getContextHelp(text); - Text->setText(text.toUtf8()); + Text->setText(text); } // *************************************************************************** diff --git a/ryzom/client/src/interface_v3/dbgroup_list_sheet_trade.cpp b/ryzom/client/src/interface_v3/dbgroup_list_sheet_trade.cpp index b0924f0af..aec03653b 100644 --- a/ryzom/client/src/interface_v3/dbgroup_list_sheet_trade.cpp +++ b/ryzom/client/src/interface_v3/dbgroup_list_sheet_trade.cpp @@ -248,7 +248,7 @@ void CDBGroupListSheetTrade::CSheetChildTrade::update(CDBGroupListSheetText *pFa void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetText *pFather) { H_AUTO(CDBGroupListSheetTrade_updateViewText); - ucstring text; + std::string text; Ctrl->getContextHelp(text); // Append first the type of the sheet to select switch ( Ctrl->getSheetCategory() ) @@ -268,7 +268,7 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT if (pOBS != NULL) { STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); - text += string("\n") + pSMC->getOutpostBuildingLocalizedDescription(CSheetId(Ctrl->getSheetId())); + text += string("\n") + CUtfStringView(pSMC->getOutpostBuildingLocalizedDescription(CSheetId(Ctrl->getSheetId()))).toUtf8(); text += "\n" + CI18N::get("uiBotChatPrice") + NLMISC::formatThousands(toString(pOBS->CostDapper)); text += CI18N::get("uiBotChatTime") + toString(pOBS->CostTime/60) + CI18N::get("uiBotChatTimeMinute"); if ((pOBS->CostTime % 60) != 0) @@ -285,15 +285,15 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT bool melee,range; pPM->getCombatWeaponRestriction(weaponRestriction, Ctrl->getSheetId(),melee,range); // don't add also if no combat restriction - if(!weaponRestriction.empty() && weaponRestriction!=CI18N::get("uiawrSF")) + if(!weaponRestriction.empty() && weaponRestriction!=CI18N::getAsUtf16("uiawrSF")) { weaponRestriction= CI18N::get("uiPhraseWRHeader") + weaponRestriction; - text+= "\n" + weaponRestriction; + text+= "\n" + weaponRestriction.toUtf8(); } } // Get the Text color - ucstring colorTag("@{FFFF}"); + std::string colorTag("@{FFFF}"); if(Ctrl->getType() == CCtrlSheetInfo::SheetType_Item) { if(!Ctrl->checkItemRequirement()) @@ -309,7 +309,7 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT // Add craft info for MP if(pIS->Family==ITEMFAMILY::RAW_MATERIAL) { - ucstring ipList; + string ipList; pIS->getItemPartListAsText(ipList); if(ipList.empty()) { @@ -412,7 +412,7 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT else text+= CI18N::get("uiBotChatRetirePrice") + NLMISC::formatThousands(toString(factor * LastPriceRetire)); // set resale time left - ucstring fmt= CI18N::get("uiBotChatResaleTimeLeft"); + std::string fmt= CI18N::get("uiBotChatResaleTimeLeft"); strFindReplace(fmt, "%d", toString(LastResaleTimeLeft/RYZOM_DAY_IN_HOUR)); strFindReplace(fmt, "%h", toString(LastResaleTimeLeft%RYZOM_DAY_IN_HOUR)); text+= "\n" + fmt; @@ -431,7 +431,7 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT // else display the name of the vendor (not if this is the player himself, to avoid flood) else if (LastSellerType == BOTCHATTYPE::Resale) { - text+= "\n" + CI18N::get("uiBotChatVendorTag") + VendorNameString; + text+= "\n" + CI18N::get("uiBotChatVendorTag") + VendorNameString.toUtf8(); } } } @@ -457,7 +457,7 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT // setup color and text text= colorTag + text; - Text->setTextFormatTaged(text.toUtf8()); + Text->setTextFormatTaged(text); } // *************************************************************************** diff --git a/ryzom/client/src/interface_v3/encyclopedia_manager.cpp b/ryzom/client/src/interface_v3/encyclopedia_manager.cpp index 6ab68522d..c9912325f 100644 --- a/ryzom/client/src/interface_v3/encyclopedia_manager.cpp +++ b/ryzom/client/src/interface_v3/encyclopedia_manager.cpp @@ -205,7 +205,7 @@ void CEncyclopediaManager::rebuildAlbumList() if (_Albums[i].Name == _AlbumNameSelected) pAlb->Opened = true; if (pSMC->getDynString(_Albums[i].Name, res)) - pAlb->Text = res; + pAlb->Text = res.toUtf8(); else nlwarning("try to construct album without name"); @@ -217,7 +217,7 @@ void CEncyclopediaManager::rebuildAlbumList() pThm->AHName = "ency_click_thema"; pThm->AHParams = toString(_Albums[i].Themas[j].Name); if (pSMC->getDynString(_Albums[i].Themas[j].Name, res)) - pThm->Text = res; + pThm->Text = res.toUtf8(); else nlwarning("try to construct thema without name"); diff --git a/ryzom/client/src/interface_v3/group_compas.cpp b/ryzom/client/src/interface_v3/group_compas.cpp index 3c18eb22c..f7418e868 100644 --- a/ryzom/client/src/interface_v3/group_compas.cpp +++ b/ryzom/client/src/interface_v3/group_compas.cpp @@ -424,11 +424,10 @@ void CGroupCompas::draw() CCtrlBase *toolTip = getCtrl("tt"); if (toolTip) { - ucstring text; if (displayedTarget.getType() != CCompassTarget::North) toolTip->setDefaultContextHelp(CI18N::get("uittCompassDistance")); else - toolTip->setDefaultContextHelp(text); + toolTip->setDefaultContextHelp(std::string()); } if (displayedTarget.Name != _CurrTargetName) @@ -711,7 +710,7 @@ void CGroupCompasMenu::setActive (bool state) ct.setType(CCompassTarget::North); ct.Name = CI18N::get("uiNorth"); Targets.push_back(ct); - getRootMenu()->addLineAtIndex(lineIndex ++, ct.Name, "set_compas", toString ("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); + getRootMenu()->addLineAtIndex(lineIndex ++, ct.Name.toUtf8(), "set_compas", toString ("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); // Home CCDBNodeLeaf *pos = NLGUI::CDBManager::getInstance()->getDbProp(COMPASS_DB_PATH ":HOME_POINT"); sint32 px = (sint32) (pos->getValue64() >> 32); @@ -721,7 +720,7 @@ void CGroupCompasMenu::setActive (bool state) ct.setType(CCompassTarget::Home); ct.Name = CI18N::get("uiHome"); Targets.push_back(ct); - getRootMenu()->addLineAtIndex(lineIndex ++, ct.Name, "set_compas", toString ("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); + getRootMenu()->addLineAtIndex(lineIndex ++, ct.Name.toUtf8(), "set_compas", toString ("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); } // Respawn pos = NLGUI::CDBManager::getInstance()->getDbProp(COMPASS_DB_PATH ":BIND_POINT"); @@ -732,7 +731,7 @@ void CGroupCompasMenu::setActive (bool state) ct.setType(CCompassTarget::Respawn); ct.Name = CI18N::get("uiRespawn"); Targets.push_back(ct); - getRootMenu()->addLineAtIndex(lineIndex ++, ct.Name, "set_compas", toString ("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); + getRootMenu()->addLineAtIndex(lineIndex ++, ct.Name.toUtf8(), "set_compas", toString ("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); } // As of 6/5/2007 : The option to point the selection is always proposed even if no slot is currently targeted @@ -742,7 +741,7 @@ void CGroupCompasMenu::setActive (bool state) if (entity != NULL) {*/ //ucstring targetName = CI18N::get("uiTargetTwoPoint") + entity->removeTitleAndShardFromName(entity->getEntityName()); - ucstring targetName = CI18N::get("uiTarget"); + std::string targetName = CI18N::get("uiTarget"); ct.setType(CCompassTarget::Selection); ct.Name = targetName; Targets.push_back(ct); @@ -790,7 +789,7 @@ void CGroupCompasMenu::setActive (bool state) ct.setPositionState(tracker); ct.Name = name; Targets.push_back(ct); - missionSubMenu->addLine(ct.Name, "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); + missionSubMenu->addLine(ct.Name.toUtf8(), "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); selectable= true; } } @@ -847,7 +846,7 @@ void CGroupCompasMenu::setActive (bool state) ct.Pos = currCont->ContLandMarks[k].Pos; ct.Name = CStringManagerClient::getPlaceLocalizedName(currCont->ContLandMarks[k].TitleTextID); Targets.push_back(ct); - landMarkSubMenu->addLineAtIndex(contLandMarkIndex++, ct.Name, "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); + landMarkSubMenu->addLineAtIndex(contLandMarkIndex++, ct.Name.toUtf8(), "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); selectable= true; } // separator? @@ -870,7 +869,7 @@ void CGroupCompasMenu::setActive (bool state) ct.Pos = sortedLandmarks[k].Pos; ct.Name = sortedLandmarks[k].Title; Targets.push_back(ct); - landMarkSubMenus[sortedLandmarks[k].Type]->addLine(ct.Name, "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); + landMarkSubMenus[sortedLandmarks[k].Type]->addLine(ct.Name.toUtf8(), "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); selectable= true; } } @@ -901,7 +900,7 @@ void CGroupCompasMenu::setActive (bool state) if (buildCompassTargetFromTeamMember(ct, k)) { Targets.push_back(ct); - teamSubMenu->addLine(ct.Name, "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); + teamSubMenu->addLine(ct.Name.toUtf8(), "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); selectable= true; } } @@ -924,7 +923,7 @@ void CGroupCompasMenu::setActive (bool state) if (buildCompassTargetFromAnimalMember(ct, k)) { Targets.push_back(ct); - animalSubMenu->addLine(ct.Name, "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); + animalSubMenu->addLine(ct.Name.toUtf8(), "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); selectable= true; } } @@ -952,7 +951,7 @@ void CGroupCompasMenu::setActive (bool state) CSmartPtr tracker = new CDialogEntityPositionState( i ); ct.setPositionState(tracker); Targets.push_back(ct); - dialogsSubMenu->addLine(ct.Name, "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); + dialogsSubMenu->addLine(ct.Name.toUtf8(), "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); selectable= true; } } diff --git a/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp b/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp index f070d3224..b6b0195ef 100644 --- a/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp +++ b/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp @@ -759,7 +759,7 @@ CGroupInSceneBubbleManager::CPopupContext *CGroupInSceneBubbleManager::buildCont void CGroupInSceneBubbleManager::addContextHelp (const ucstring &message, const string &targetName, uint time) { - ucstring finalMessage = message; + std::string finalMessage = message.toUtf8(); CInterfaceElement *target; CPopupContext *context = CGroupInSceneBubbleManager::buildContextHelp ("context_help_", targetName, target, time); if (context) @@ -787,7 +787,7 @@ void CGroupInSceneBubbleManager::addContextHelp (const ucstring &message, const } } - text->setText(finalMessage.toUtf8()); + text->setText(finalMessage); } } context->Group->setActive(true); diff --git a/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp b/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp index fe846038c..bd339d19d 100644 --- a/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp +++ b/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp @@ -1122,7 +1122,7 @@ void CGroupInSceneUserInfo::updateDynamicData () { CInterfaceGroup *group = getGroup ("right"); CForageSourceCL *forageSource = static_cast(_Entity); - ucstring txt( CI18N::get( "uittForageContent" ) + toString( ": %u", forageSource->getCurrentQuantity() ) ); + string txt( CI18N::get( "uittForageContent" ) + toString( ": %u", forageSource->getCurrentQuantity() ) ); CCtrlBase *toolTip = group->getCtrl ("tt1"); if ( toolTip ) toolTip->setDefaultContextHelp( txt ); diff --git a/ryzom/client/src/interface_v3/group_map.cpp b/ryzom/client/src/interface_v3/group_map.cpp index ed91842f7..3c567ff36 100644 --- a/ryzom/client/src/interface_v3/group_map.cpp +++ b/ryzom/client/src/interface_v3/group_map.cpp @@ -1179,7 +1179,7 @@ void CGroupMap::checkCoords() ucstring result; if (STRING_MANAGER::CStringManagerClient::instance()->getDynString(_MissionTargetTextIDs[k], result)) { - _MissionLM[k]->setDefaultContextHelp(result); + _MissionLM[k]->setDefaultContextHelp(result.toUtf8()); _MissionTargetTextReceived[k] = true; } } @@ -1201,7 +1201,7 @@ void CGroupMap::checkCoords() CEntityCL *sel = EntitiesMngr.entity(UserEntity->selection()); if (sel) { - _TargetLM->setDefaultContextHelp(NLMISC::CI18N::get("uiTargetTwoPoint") + sel->removeTitleAndShardFromName(sel->getEntityName())); + _TargetLM->setDefaultContextHelp(NLMISC::CI18N::get("uiTargetTwoPoint") + sel->removeTitleAndShardFromName(sel->getEntityName()).toUtf8()); } } } @@ -1368,7 +1368,7 @@ void CGroupMap::checkCoords() if (pSMC->getString(val,res)) { res = CEntityCL::removeTitleAndShardFromName(res); - _TeammateLM[i]->setDefaultContextHelp(res); + _TeammateLM[i]->setDefaultContextHelp(res.toUtf8()); } } updateLMPosFromDBPos(_TeammateLM[i], px, py); @@ -2723,7 +2723,7 @@ void CGroupMap::addLandMark(TLandMarkButtonVect &destList, const NLMISC::CVector CLandMarkButton *lmb = createLandMarkButton(options); lmb->setParent(this); lmb->Pos = pos; - lmb->setDefaultContextHelp(title); + lmb->setDefaultContextHelp(title.toUtf8()); destList.push_back(lmb); addCtrl(lmb); } @@ -2805,7 +2805,7 @@ void CGroupMap::updateUserLandMark(CCtrlButton *button, const ucstring &newTitle _CurContinent->UserLandMarks[k].Type = (uint8)lmType; updateLandMarkButton(_UserLM[k], getUserLandMarkOptions(k)); - button->setDefaultContextHelp(newTitle); + button->setDefaultContextHelp(newTitle.toUtf8()); CInterfaceManager::getInstance()->saveLandmarks(); return; @@ -3067,7 +3067,7 @@ void CGroupMap::targetLandmark(CCtrlButton *lm) if (it != _ContinentLM.end()) { ct.setType(CCompassTarget::ContinentLandMark); - (*it)->getContextHelp(ct.Name); + (*it)->getContextHelpAsUtf16(ct.Name); mapToWorld(ct.Pos, (*it)->Pos); found = true; } @@ -3080,7 +3080,7 @@ void CGroupMap::targetLandmark(CCtrlButton *lm) if (it != _MissionLM.end()) { ct.setPositionState(_MissionPosStates[it - _MissionLM.begin()]); - (*it)->getContextHelp(ct.Name); + (*it)->getContextHelpAsUtf16(ct.Name); mapToWorld(ct.Pos, (*it)->Pos); found = true; } @@ -3094,7 +3094,7 @@ void CGroupMap::targetLandmark(CCtrlButton *lm) if (it != _UserLM.end()) { ct.setType(CCompassTarget::UserLandMark); - (*it)->getContextHelp(ct.Name); + (*it)->getContextHelpAsUtf16(ct.Name); mapToWorld(ct.Pos, (*it)->Pos); found = true; } @@ -3122,7 +3122,7 @@ void CGroupMap::targetLandmark(CCtrlButton *lm) if (!isIsland()) { ct.setType(CCompassTarget::Respawn); - (*it)->getContextHelp(ct.Name); + (*it)->getContextHelpAsUtf16(ct.Name); mapToWorld(ct.Pos, (*it)->Pos); found = true; } @@ -3168,7 +3168,7 @@ void CGroupMap::targetLandmark(CCtrlButton *lm) { if(_AnimalLM[i]==lm) { - _AnimalLM[i]->getContextHelp(ct.Name); + _AnimalLM[i]->getContextHelpAsUtf16(ct.Name); // copy The Animal Pos retriever into the compass ct.setPositionState(_AnimalPosStates[i]); found = true; @@ -3186,7 +3186,7 @@ void CGroupMap::targetLandmark(CCtrlButton *lm) { if(_TeammateLM[i]==lm) { - _TeammateLM[i]->getContextHelp(ct.Name); + _TeammateLM[i]->getContextHelpAsUtf16(ct.Name); // copy The Animal Pos retriever into the compass ct.setPositionState(_TeammatePosStates[i]); found = true; @@ -3248,7 +3248,7 @@ CGroupMap::CLandMarkButton* CGroupMap::findClosestLandmark(const CVector2f ¢ for(TLandMarkButtonVect::const_iterator it = landmarks.begin(); it != landmarks.end(); ++it) { ucstring lc; - (*it)->getContextHelp(lc); + (*it)->getContextHelpAsUtf16(lc); if(filterLandmark(lc, keywords, startsWith)) { CVector2f pos; mapToWorld(pos, (*it)->Pos); @@ -3310,7 +3310,7 @@ bool CGroupMap::targetLandmarkByName(const ucstring &search, bool startsWith) co { ct.setType(CCompassTarget::UserLandMark); mapToWorld(ct.Pos, lm->Pos); - lm->getContextHelp(ct.Name); + lm->getContextHelpAsUtf16(ct.Name); closest = dist; found = true; } @@ -3323,7 +3323,7 @@ bool CGroupMap::targetLandmarkByName(const ucstring &search, bool startsWith) co { ct.setType(CCompassTarget::ContinentLandMark); mapToWorld(ct.Pos, lm->Pos); - lm->getContextHelp(ct.Name); + lm->getContextHelpAsUtf16(ct.Name); closest = dist; found = true; } @@ -3647,7 +3647,7 @@ void CGroupMap::updateClosestLandMarkMenu(const std::string &menu, const NLMISC: std::string lineId = toString("%s:lmcosest%d", menu.c_str(), i); std::string ahParams = toString("type=user|map=%s|index=%d", _Id.c_str(), index); - CViewTextMenu* vt = rootMenu->addLine(ucstring(""), "map_landmark_by_index", ahParams, lineId.c_str(), "", "", false, false, false); + CViewTextMenu* vt = rootMenu->addLine(std::string(), "map_landmark_by_index", ahParams, lineId.c_str(), "", "", false, false, false); if (!vt) break; vt->setSingleLineTextFormatTaged(name.toUtf8()); diff --git a/ryzom/client/src/interface_v3/group_modal_get_key.cpp b/ryzom/client/src/interface_v3/group_modal_get_key.cpp index e3791cf8e..6f28e3b65 100644 --- a/ryzom/client/src/interface_v3/group_modal_get_key.cpp +++ b/ryzom/client/src/interface_v3/group_modal_get_key.cpp @@ -89,7 +89,7 @@ bool CGroupModalGetKey::handleEvent (const NLGUI::CEventDescriptor &event) // Setup the text ! CInterfaceManager *pIM = CInterfaceManager::getInstance(); CViewText *pVT= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( VIEW_TEXT_KEY )); - if (pVT != NULL) pVT->setText(Combo.toUCString().toUtf8()); + if (pVT != NULL) pVT->setText(Combo.toString()); // Check if in use CActionsManager *pCurAM = NULL; diff --git a/ryzom/client/src/interface_v3/group_phrase_skill_filter.cpp b/ryzom/client/src/interface_v3/group_phrase_skill_filter.cpp index 04d05e6f2..62d96280f 100644 --- a/ryzom/client/src/interface_v3/group_phrase_skill_filter.cpp +++ b/ryzom/client/src/interface_v3/group_phrase_skill_filter.cpp @@ -224,7 +224,7 @@ void CGroupPhraseSkillFilter::rebuild() // just text pNode->DisplayText = true; pNode->Template = NULL; - pNode->Text= STRING_MANAGER::CStringManagerClient::getSkillLocalizedName((SKILLS::ESkills)i);; + pNode->Text = CUtfStringView(STRING_MANAGER::CStringManagerClient::getSkillLocalizedName((SKILLS::ESkills)i)).toUtf8(); // Action handler? if(!_AHCtrlNode.empty()) diff --git a/ryzom/client/src/interface_v3/group_quick_help.cpp b/ryzom/client/src/interface_v3/group_quick_help.cpp index 0b789fccf..77775489f 100644 --- a/ryzom/client/src/interface_v3/group_quick_help.cpp +++ b/ryzom/client/src/interface_v3/group_quick_help.cpp @@ -244,7 +244,7 @@ void CGroupQuickHelp::beginElement(CHtmlElement &elm) CActionsManager::TActionComboMap::const_iterator ite = actionCombo.find (CAction::CName (elm.getAttribute("z_action_shortcut").c_str(), params.c_str())); if (ite != actionCombo.end()) { - addString (ite->second.toUCString()); + addString (ite->second.toString()); } } } diff --git a/ryzom/client/src/interface_v3/group_skills.cpp b/ryzom/client/src/interface_v3/group_skills.cpp index 053bddf86..4248ea898 100644 --- a/ryzom/client/src/interface_v3/group_skills.cpp +++ b/ryzom/client/src/interface_v3/group_skills.cpp @@ -245,11 +245,11 @@ static DECLARE_INTERFACE_USER_FCT(getSkillBaseText) if(skillValue!=skillBase) { - result.setUCString( toString("(%d)", skillBase) ); + result.setString( toString("(%d)", skillBase) ); } else { - result.setUCString( ucstring() ); + result.setString( std::string() ); } return true; @@ -335,7 +335,7 @@ void CGroupSkills::createAllTreeNodes() // local variable (avoid realloc in loop) vector< pair > tempVec(2); - ucstring sSkillName; + string sSkillName; while ((!bQuit) && (nCounter < 32)) // Counter is used to not infinitly loop { @@ -365,7 +365,7 @@ void CGroupSkills::createAllTreeNodes() pNode->Id = NLMISC::toString(i); // get Skill Name - sSkillName = STRING_MANAGER::CStringManagerClient::getSkillLocalizedName((SKILLS::ESkills)i); + sSkillName = CUtfStringView(STRING_MANAGER::CStringManagerClient::getSkillLocalizedName((SKILLS::ESkills)i)).toUtf8(); // just text or template? if(_TemplateSkill.empty()) @@ -387,7 +387,7 @@ void CGroupSkills::createAllTreeNodes() // Set Skill Name CViewText *pViewSkillName = dynamic_cast(pIG->getView("name")); if (pViewSkillName != NULL) - pViewSkillName->setText (sSkillName.toUtf8()); + pViewSkillName->setText (sSkillName); // Set Skill Max Value CViewText *pViewSkillMax = dynamic_cast(pIG->getView("max")); if (pViewSkillMax != NULL) diff --git a/ryzom/client/src/interface_v3/guild_manager.cpp b/ryzom/client/src/interface_v3/guild_manager.cpp index 3a25c0198..331b0ebfe 100644 --- a/ryzom/client/src/interface_v3/guild_manager.cpp +++ b/ryzom/client/src/interface_v3/guild_manager.cpp @@ -837,13 +837,13 @@ class CAHGuildSheetOpen : public IActionHandler if (pViewGrade != NULL) { if (rGuildMembers[i].Grade == EGSPD::CGuildGrade::Leader) - pViewGrade->setText (CI18N::get("uiGuildLeader").toUtf8()); + pViewGrade->setText (CI18N::get("uiGuildLeader")); else if (rGuildMembers[i].Grade == EGSPD::CGuildGrade::HighOfficer) - pViewGrade->setText (CI18N::get("uiGuildHighOfficer").toUtf8()); + pViewGrade->setText (CI18N::get("uiGuildHighOfficer")); else if (rGuildMembers[i].Grade == EGSPD::CGuildGrade::Officer) - pViewGrade->setText (CI18N::get("uiGuildOfficer").toUtf8()); + pViewGrade->setText (CI18N::get("uiGuildOfficer")); else - pViewGrade->setText (CI18N::get("uiGuildMember").toUtf8()); + pViewGrade->setText (CI18N::get("uiGuildMember")); } // online? diff --git a/ryzom/client/src/interface_v3/interface_expr_user_fct_game.cpp b/ryzom/client/src/interface_v3/interface_expr_user_fct_game.cpp index 5dbf8dae5..77a2de4f6 100644 --- a/ryzom/client/src/interface_v3/interface_expr_user_fct_game.cpp +++ b/ryzom/client/src/interface_v3/interface_expr_user_fct_game.cpp @@ -176,7 +176,7 @@ static DECLARE_INTERFACE_USER_FCT(getCompassText) "uiWNW", }; - result.setUCString( CI18N::get(txts[direction]) ); + result.setString( CI18N::get(txts[direction]) ); return true; } REGISTER_INTERFACE_USER_FCT("getCompassText", getCompassText); @@ -251,7 +251,7 @@ static DECLARE_INTERFACE_USER_FCT(getDifficultyText) } SENTENCE_APPRAISAL::ESentenceAppraisal sa = (SENTENCE_APPRAISAL::ESentenceAppraisal)args[0].getInteger(); - result.setUCString (CI18N::get(SENTENCE_APPRAISAL::toString(sa))); + result.setString (CI18N::get(SENTENCE_APPRAISAL::toString(sa))); return true; } @@ -665,14 +665,14 @@ static DECLARE_INTERFACE_USER_FCT(getKey) CActionsManager::TActionComboMap::const_iterator it = acmap.find(CAction::CName(name.c_str(),param.c_str())); if (it != acmap.end()) { - result.setUCString (it->second.toUCString()); + result.setString (it->second.toString()); } else { if (notna) - result.setUCString (ucstring("")); + result.setString (std::string()); else - result.setUCString (CI18N::get("uiNotAssigned")); + result.setString (CI18N::get("uiNotAssigned")); } return true; @@ -1008,9 +1008,9 @@ static DECLARE_INTERFACE_USER_FCT(getBotChatBuyFilterMPText) RM_FABER_TYPE::TRMFType faberType= (RM_FABER_TYPE::TRMFType)args[0].getInteger(); if(faberType>=RM_FABER_TYPE::Unknown) - result.setUCString(CI18N::get("uittBCNoItemPartFilter")); + result.setString(CI18N::get("uittBCNoItemPartFilter")); else - result.setUCString(RM_FABER_TYPE::toLocalString(faberType)); + result.setString(RM_FABER_TYPE::toLocalString(faberType)); return true; } @@ -1059,15 +1059,15 @@ static DECLARE_INTERFACE_USER_FCT(getOutpostName) uint32 nSheet = (uint32)args[0].getInteger(); if (nSheet == 0) { - result.setUCString(string("")); + result.setString(string()); return true; } // get sheet name STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); - const ucstring name(pSMC->getOutpostLocalizedName(CSheetId(nSheet))); + const std::string name = CUtfStringView(pSMC->getOutpostLocalizedName(CSheetId(nSheet))).toUtf8(); - result.setUCString(name); + result.setString(name); return true; } @@ -1086,15 +1086,15 @@ static DECLARE_INTERFACE_USER_FCT(getOutpostDesc) uint32 nSheet = (uint32)args[0].getInteger(); if (nSheet == 0) { - result.setUCString(string("")); + result.setString(string()); return true; } // get sheet name STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); - const ucstring name(pSMC->getOutpostLocalizedDescription(CSheetId(nSheet))); + const string name = CUtfStringView(pSMC->getOutpostLocalizedDescription(CSheetId(nSheet))).toUtf8(); - result.setUCString(name); + result.setString(name); return true; } @@ -1113,15 +1113,15 @@ static DECLARE_INTERFACE_USER_FCT(getOutpostBuildingName) uint32 nSheet = (uint32)args[0].getInteger(); if (nSheet == 0) { - result.setUCString(string("")); + result.setString(string()); return true; } // get sheet name STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); - const ucstring name(pSMC->getOutpostBuildingLocalizedName(CSheetId(nSheet))); + const string name = CUtfStringView(pSMC->getOutpostBuildingLocalizedName(CSheetId(nSheet))).toUtf8(); - result.setUCString(name); + result.setString(name); return true; } @@ -1140,12 +1140,12 @@ static DECLARE_INTERFACE_USER_FCT(getOutpostBuildingDesc) uint32 nSheet = (uint32)args[0].getInteger(); if (nSheet == 0) { - result.setUCString(string("")); + result.setString(string()); return true; } // get sheet name - ucstring name; + string name; CEntitySheet *pSheet= SheetMngr.get(CSheetId(nSheet)); COutpostBuildingSheet *pOBS = dynamic_cast(pSheet); if (pOBS && pOBS->OBType == COutpostBuildingSheet::OB_Empty) @@ -1156,11 +1156,11 @@ static DECLARE_INTERFACE_USER_FCT(getOutpostBuildingDesc) else { STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); - name = pSMC->getOutpostBuildingLocalizedDescription(CSheetId(nSheet)); + name = CUtfStringView(pSMC->getOutpostBuildingLocalizedDescription(CSheetId(nSheet))).toUtf8(); } - result.setUCString(name); + result.setString(name); return true; } @@ -1179,15 +1179,15 @@ static DECLARE_INTERFACE_USER_FCT(getSquadName) uint32 nSheet = (uint32)args[0].getInteger(); if (nSheet == 0) { - result.setUCString(string("")); + result.setString(string()); return true; } // get sheet name STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); - const ucstring name(pSMC->getSquadLocalizedName(CSheetId(nSheet))); + const string name = CUtfStringView(pSMC->getSquadLocalizedName(CSheetId(nSheet))).toUtf8(); - result.setUCString(name); + result.setString(name); return true; } @@ -1206,15 +1206,15 @@ static DECLARE_INTERFACE_USER_FCT(getSquadDesc) uint32 nSheet = (uint32)args[0].getInteger(); if (nSheet == 0) { - result.setUCString(string("")); + result.setString(string()); return true; } // get sheet name STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); - const ucstring name(pSMC->getSquadLocalizedDescription(CSheetId(nSheet))); + const string name = CUtfStringView(pSMC->getSquadLocalizedDescription(CSheetId(nSheet))).toUtf8(); - result.setUCString(name); + result.setString(name); return true; } @@ -1267,7 +1267,7 @@ static DECLARE_INTERFACE_USER_FCT(getOutpostPeriod) // if status wanted is peace or unknow, then "N/A", because there is no attack period in peace mode if( status==OUTPOSTENUMS::Peace || status==OUTPOSTENUMS::UnknownOutpostState ) { - result.setUCString(string(" - ")); + result.setString(string(" - ")); return true; } @@ -1275,7 +1275,7 @@ static DECLARE_INTERFACE_USER_FCT(getOutpostPeriod) if( (isAttackPeriod && status>OUTPOSTENUMS::AttackRound) || (!isAttackPeriod && status>OUTPOSTENUMS::DefenseRound) ) { - result.setUCString(CI18N::get("uiOutpostPeriodEnded")); + result.setString(CI18N::get("uiOutpostPeriodEnded")); return true; } @@ -1295,7 +1295,7 @@ static DECLARE_INTERFACE_USER_FCT(getOutpostPeriod) tstruct= gmtime(&tval); if(!tstruct) { - result.setUCString(string("Bad Date Received")); + result.setString(string("Bad Date Received")); return true; } dname= tstruct->tm_wday; // 0-6 (Sunday==0!!) @@ -1308,21 +1308,21 @@ static DECLARE_INTERFACE_USER_FCT(getOutpostPeriod) tstruct= gmtime(&tval); if(!tstruct) { - result.setUCString(string("Bad Date Received")); + result.setString(string("Bad Date Received")); return true; } hend= tstruct->tm_hour; // 0-23 mend= tstruct->tm_min; // 0-59 // translate - ucstring res= CI18N::get("uiOutpostPeriodFormat"); + string res= CI18N::get("uiOutpostPeriodFormat"); strFindReplace( res, "%dayname", CI18N::get(toString("uiDay%d", dname)) ); strFindReplace( res, "%daynumber", toString(dnumber) ); strFindReplace( res, "%month", CI18N::get(toString("uiMonth%02d", month+1)) ); strFindReplace( res, "%timestart", toString("%02d:%02d", hstart, mstart) ); strFindReplace( res, "%timeend", toString("%02d:%02d", hend, mend) ); - result.setUCString(res); + result.setString(res); return true; } REGISTER_INTERFACE_USER_FCT("getOutpostPeriod", getOutpostPeriod) diff --git a/ryzom/client/src/interface_v3/interface_expr_user_fct_items.cpp b/ryzom/client/src/interface_v3/interface_expr_user_fct_items.cpp index 9aeec4e5f..b686db2be 100644 --- a/ryzom/client/src/interface_v3/interface_expr_user_fct_items.cpp +++ b/ryzom/client/src/interface_v3/interface_expr_user_fct_items.cpp @@ -312,16 +312,16 @@ static DECLARE_INTERFACE_USER_FCT(getSheetName) // if from ctrlSheet, then take the correct ACTUAL name (ie from NAMEID if not 0) if(ctrlSheet) { - result.setUCString(ctrlSheet->getItemActualName()); + result.setString(ctrlSheet->getItemActualName().toUtf8()); return true; } // Standard (but less accurate) way else { const CItemSheet *itemSheet = getItemSheet(args); - ucstring tmp; - if (itemSheet != NULL) tmp = STRING_MANAGER::CStringManagerClient::getItemLocalizedName(itemSheet->Id); - result.setUCString(tmp); + string tmp; + if (itemSheet != NULL) tmp = CUtfStringView(STRING_MANAGER::CStringManagerClient::getItemLocalizedName(itemSheet->Id)).toUtf8(); + result.setString(tmp); return true; } } @@ -345,9 +345,9 @@ static DECLARE_INTERFACE_USER_FCT(getItemTranslatedName) return false; } - ucstring tmp; - tmp = STRING_MANAGER::CStringManagerClient::getItemLocalizedName(sheet); - result.setUCString(tmp); + string tmp; + tmp = CUtfStringView(STRING_MANAGER::CStringManagerClient::getItemLocalizedName(sheet)).toUtf8(); + result.setString(tmp); return true; } REGISTER_INTERFACE_USER_FCT("getItemTranslatedName", getItemTranslatedName) diff --git a/ryzom/client/src/interface_v3/interface_manager.cpp b/ryzom/client/src/interface_v3/interface_manager.cpp index 3772ef176..ad6841914 100644 --- a/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/ryzom/client/src/interface_v3/interface_manager.cpp @@ -324,12 +324,12 @@ class CStringManagerTextProvider : public CViewTextID::IViewTextProvider class CRyzomTextFormatter : public CViewTextFormated::IViewTextFormatter { public: - ucstring formatString( const ucstring &inputString, const ucstring ¶mString ) + std::string formatString( const std::string &inputString, const std::string ¶mString ) { - ucstring formatedResult; + std::string formatedResult; // Apply the format - for(ucstring::const_iterator it = inputString.begin(); it != inputString.end();) + for(std::string::const_iterator it = inputString.begin(); it != inputString.end();) { if (*it == '$') { @@ -347,14 +347,15 @@ public: case 'p': // add player name if (ClientCfg.Local) { - formatedResult += ucstring("player"); + if (*it == 'P') formatedResult += "PLAYER"; + else formatedResult += "Player"; } else { if(UserEntity) { - ucstring name = UserEntity->getEntityName(); - if (*it == 'P') setCase(name, CaseUpper); + std::string name = UserEntity->getEntityName().toUtf8(); + if (*it == 'P') name = toUpper(name); formatedResult += name; } } @@ -363,11 +364,11 @@ public: case 's': case 'b': // add bot name { - ucstring botName; + string botName; bool womanTitle = false; if (ClientCfg.Local) { - botName = ucstring("NPC"); + botName = "NPC"; } else { @@ -387,7 +388,7 @@ public: } else { - botName = entity->getDisplayName(); + botName = entity->getDisplayName().toUtf8(); } CCharacterCL *pChar = dynamic_cast(entity); if (pChar != NULL) @@ -396,40 +397,40 @@ public: } } // get the title translated - ucstring sTitleTranslated = botName; + ucstring sTitleTranslated = botName; // FIXME: UTF-8 CStringPostProcessRemoveName spprn; spprn.Woman = womanTitle; spprn.cbIDStringReceived(sTitleTranslated); - botName = CEntityCL::removeTitleAndShardFromName(botName); + botName = CEntityCL::removeTitleAndShardFromName(botName).toUtf8(); // short name (with no title such as 'guard', 'merchant' ...) if (*it == 's') { // But if there is no name, display only the title if (botName.empty()) - botName = sTitleTranslated; + botName = sTitleTranslated.toUtf8(); } else { // Else we want the title ! if (!botName.empty()) botName += " "; - botName += sTitleTranslated; + botName += sTitleTranslated.toUtf8(); } formatedResult += botName; } break; default: - formatedResult += (ucchar) '$'; + formatedResult += '$'; break; } ++it; } else { - formatedResult += (ucchar) *it; + formatedResult += *it; ++it; } } @@ -1537,7 +1538,7 @@ void CInterfaceManager::updateFrameEvents() CCtrlBase *pTooltip= dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:weather_tt")); if (pTooltip != NULL) { - ucstring tt = toString("%02d", WeatherManager.getNextWeatherHour()) + CI18N::get("uiMissionTimerHour") + + string tt = toString("%02d", WeatherManager.getNextWeatherHour()) + CI18N::get("uiMissionTimerHour") + " - " + CI18N::get("uiHumidity") + " " + toString("%d", (uint)(roundWeatherValue(WeatherManager.getNextWeatherValue()) * 100.f)) + "%"; pTooltip->setDefaultContextHelp(tt); @@ -2304,7 +2305,7 @@ void CInterfaceManager::addServerString (const std::string &sTarget, uint32 id, if (id == 0) { CInterfaceExprValue val; - val.setUCString (ucstring("")); + val.setString (std::string()); CInterfaceLink::setTargetProperty (sTarget, val); return; } @@ -2322,7 +2323,7 @@ void CInterfaceManager::addServerID (const std::string &sTarget, uint32 id, IStr if (id == 0) { CInterfaceExprValue val; - val.setUCString (ucstring("")); + val.setString (std::string()); CInterfaceLink::setTargetProperty (sTarget, val); return; } @@ -2368,7 +2369,7 @@ void CInterfaceManager::processServerIDString() if (bValid) { - val.setUCString (ucstrToAffect); + val.setString (ucstrToAffect.toUtf8()); CInterfaceLink::setTargetProperty (pISW->Target, val); } @@ -3337,7 +3338,7 @@ void CInterfaceManager::initEmotes() translateEmote(sTmp, sTranslatedName, sCommandName, sCommandNameAlt); // Create a line - pMenu->addLine (sTranslatedName + " (/" + ucstring::makeFromUtf8(sCommandName) + ")", "emote", + pMenu->addLine (sTranslatedName.toUtf8() + " (/" + sCommandName + ")", "emote", "nb="+toString(nEmoteNb)+"|behav="+toString(nBehav), sTmp); } } @@ -3393,7 +3394,7 @@ void CInterfaceManager::initEmotes() { // Yeah that's a quick emote too; set command pMenu->addLineAtIndex (i, - "@{FFFF}/" + ucstring::makeFromUtf8(sCommandName), + "@{FFFF}/" + sCommandName, "emote", "nb="+toString(nEmoteNb)+"|behav="+toString(nBehav), "", "", "", false, false, true); @@ -4041,11 +4042,11 @@ char* CInterfaceManager::getTimestampHuman(const char* format /* "[%H:%M:%S] " * * * All \d's in default parameter remove a following character. */ -bool CInterfaceManager::parseTokens(ucstring& ucstr) +bool CInterfaceManager::parseTokens(string& ucstr) { - ucstring str = ucstr; - ucstring start_token("$"); - ucstring end_token("$"); + string str = ucstr; + string start_token("$"); + string end_token("$"); size_t start_pos = 0; size_t end_pos = 1; @@ -4062,8 +4063,8 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr) // Get the whole token substring first end_pos = str.find(end_token, start_pos + 1); - if ((start_pos == ucstring::npos) || - (end_pos == ucstring::npos) || + if ((start_pos == string::npos) || + (end_pos == string::npos) || (end_pos <= start_pos + 1)) { // Wrong formatting; give up on this one. @@ -4081,19 +4082,19 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr) continue; } - ucstring token_whole = str.luabind_substr(start_pos, end_pos - start_pos + 1); - ucstring token_string = token_whole.luabind_substr(1, token_whole.length() - 2); - ucstring token_replacement = token_whole; - ucstring token_default = token_whole; + string token_whole = str.substr(start_pos, end_pos - start_pos + 1); + string token_string = token_whole.substr(1, token_whole.length() - 2); + string token_replacement = token_whole; + string token_default = token_whole; - ucstring token_subject; - ucstring token_param; + string token_subject; + string token_param; // Does the token have a parameter? // If not it is 'name' by default - vector token_vector; - vector param_vector; - splitUCString(token_string, ucstring("."), token_vector); + vector token_vector; + vector param_vector; + splitString(token_string, ".", token_vector); if (token_vector.empty()) { // Wrong formatting; give up on this one. @@ -4103,23 +4104,23 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr) token_subject = token_vector[0]; if (token_vector.size() == 1) { - splitUCString(token_subject, ucstring("/"), param_vector); - token_subject = !param_vector.empty() ? param_vector[0] : ucstring(""); - token_param = ucstring("name"); + splitString(token_subject, "/", param_vector); + token_subject = !param_vector.empty() ? param_vector[0] : string(); + token_param = string("name"); } else if (token_vector.size() > 1) { token_param = token_vector[1]; - if (token_param.luabind_substr(0, 3) != ucstring("gs(")) + if (token_param.substr(0, 3) != "gs(") { - splitUCString(token_vector[1], ucstring("/"), param_vector); - token_param = !param_vector.empty() ? param_vector[0] : ucstring(""); + splitString(token_vector[1], "/", param_vector); + token_param = !param_vector.empty() ? param_vector[0] : string(); } } // Get any default value, if not gs sint extra_replacement = 0; - if (token_param.luabind_substr(0, 3) != ucstring("gs(")) + if (token_param.substr(0, 3) != "gs(") { if (param_vector.size() == 2) { @@ -4127,9 +4128,9 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr) token_replacement = param_vector[1]; // Delete following chars for every '\d' in default string::size_type token_replacement_pos; - while ((token_replacement_pos = token_replacement.find(ucstring("\\d"))) != string::npos) + while ((token_replacement_pos = token_replacement.find(string("\\d"))) != string::npos) { - token_replacement.replace(token_replacement_pos, 2, ucstring("")); + token_replacement.replace(token_replacement_pos, 2, string()); extra_replacement++; } token_default = token_replacement; @@ -4138,17 +4139,17 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr) CEntityCL *pTokenSubjectEntity = NULL; - if (token_subject == ucstring("me")) + if (token_subject == "me") { pTokenSubjectEntity = static_cast(UserEntity); } - else if (token_subject == ucstring("t")) + else if (token_subject == "t") { // Target uint targetSlot = UserEntity->targetSlot(); pTokenSubjectEntity = EntitiesMngr.entity(targetSlot); } - else if (token_subject == ucstring("tt")) + else if (token_subject == "tt") { // Target's target uint targetSlot = UserEntity->targetSlot(); @@ -4166,11 +4167,11 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr) } } else if ((token_subject.length() == 3) && - (token_subject.luabind_substr(0, 2) == ucstring("tm"))) + (token_subject.substr(0, 2) == "tm")) { // Teammate uint indexInTeam = 0; - fromString(token_subject.luabind_substr(2, 1).toString(), indexInTeam); + fromString(token_subject.substr(2, 1), indexInTeam); // Make 0-based --indexInTeam; @@ -4206,22 +4207,22 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr) if (pTokenSubjectEntity != NULL) { // Parse the parameter - if (token_param == ucstring("name")) + if (token_param == "name") { - ucstring name = pTokenSubjectEntity->getDisplayName(); + string name = pTokenSubjectEntity->getDisplayName().toUtf8(); // special case where there is only a title, very rare case for some NPC if (name.empty()) { - name = pTokenSubjectEntity->getTitle(); + name = pTokenSubjectEntity->getTitle().toUtf8(); } token_replacement = name.empty() ? token_replacement : name; } - else if (token_param == ucstring("title")) + else if (token_param == "title") { - ucstring title = pTokenSubjectEntity->getTitle(); + string title = pTokenSubjectEntity->getTitle().toUtf8(); token_replacement = title.empty() ? token_replacement : title; } - else if (token_param == ucstring("race")) + else if (token_param == "race") { CCharacterCL *pC = dynamic_cast(pTokenSubjectEntity); if (pC) @@ -4229,27 +4230,27 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr) EGSPD::CPeople::TPeople race = pC->people(); if (race >= EGSPD::CPeople::Playable && race <= EGSPD::CPeople::EndPlayable) { - ucstring srace = NLMISC::CI18N::get("io" + EGSPD::CPeople::toString(race)); + string srace = NLMISC::CI18N::get("io" + EGSPD::CPeople::toString(race)); token_replacement = srace.empty() ? token_replacement : srace; } } } - else if (token_param == ucstring("guild")) + else if (token_param == "guild") { STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); ucstring ucGuildName; if (pSMC->getString(pTokenSubjectEntity->getGuildNameID(), ucGuildName)) { - token_replacement = ucGuildName.empty() ? token_replacement : ucGuildName; + token_replacement = ucGuildName.empty() ? token_replacement : ucGuildName.toUtf8(); } } - else if (token_param.luabind_substr(0, 3) == ucstring("gs(") && - token_param.luabind_substr(token_param.length() - 1 , 1) == ucstring(")")) + else if (token_param.substr(0, 3) == "gs(" && + token_param.substr(token_param.length() - 1 , 1) == ")") { // Gender string - vector strList; - ucstring gender_string = token_param.luabind_substr(3, token_param.length() - 4); - splitUCString(gender_string, ucstring("/"), strList); + vector strList; + string gender_string = token_param.substr(3, token_param.length() - 4); + splitString(gender_string, "/", strList); if (strList.size() <= 1) { @@ -4278,8 +4279,8 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr) { // Nothing to replace; show message and exit CInterfaceManager *im = CInterfaceManager::getInstance(); - ucstring message = ucstring(CI18N::get("uiUntranslatedToken")); - message.replace(message.find(ucstring("%s")), 2, token_whole); + string message = CI18N::get("uiUntranslatedToken"); + message.replace(message.find("%s"), 2, token_whole); im->displaySystemInfo(message); return false; } diff --git a/ryzom/client/src/interface_v3/interface_manager.h b/ryzom/client/src/interface_v3/interface_manager.h index 729f9a025..56da183b7 100644 --- a/ryzom/client/src/interface_v3/interface_manager.h +++ b/ryzom/client/src/interface_v3/interface_manager.h @@ -448,7 +448,7 @@ public: /** Parses any tokens in the ucstring like $t$ or $g()$ */ - static bool parseTokens(ucstring& ucstr); + static bool parseTokens(std::string& ucstr); // ------------------------------------------------------------------------------------------------ private: diff --git a/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index 02ff7451b..454a857d4 100644 --- a/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -266,7 +266,7 @@ static DECLARE_INTERFACE_USER_FCT(lua) if (CLuaIHM::pop(ls, ucstrVal)) { - result.setUCString(ucstrVal); + result.setString(ucstrVal.toUtf8()); ok = true; } @@ -1032,7 +1032,7 @@ int CLuaIHMRyzom::initEmotesMenu(CLuaState &ls) // Create a line pMenu->addLine(CI18N::get(sTmp), "lua", luaParams + "('" + sEmoteId + "', '" + toString(CI18N::get(sTmp)) + "')", sTmp); - emoteList[sEmoteId] = (toLower(CI18N::get(sTmp))).toUtf8(); + emoteList[sEmoteId] = (toLower(CI18N::get(sTmp))); } } @@ -2837,7 +2837,7 @@ std::string CLuaIHMRyzom::getDefine(const std::string &def) // *************************************************************************** void CLuaIHMRyzom::setContextHelpText(const ucstring &text) { - CWidgetManager::getInstance()->setContextHelpText(text); + CWidgetManager::getInstance()->setContextHelpText(text.toUtf8()); } // *************************************************************************** @@ -3565,7 +3565,7 @@ void CLuaIHMRyzom::tell(const ucstring &player, const ucstring &msg) if (!msg.empty()) { // Parse any tokens in the message. - ucstring msg_modified = msg; + string msg_modified = msg.toUtf8(); // Parse any tokens in the text if (! CInterfaceManager::parseTokens(msg_modified)) diff --git a/ryzom/client/src/interface_v3/macrocmd_key.cpp b/ryzom/client/src/interface_v3/macrocmd_key.cpp index 9fce02ef8..c04ce38cd 100644 --- a/ryzom/client/src/interface_v3/macrocmd_key.cpp +++ b/ryzom/client/src/interface_v3/macrocmd_key.cpp @@ -208,7 +208,7 @@ void getAllComboAction(uint8 nAM, CGroupList *pList, const mapsecond.Combo.Key==KeyCount) keyName= CI18N::get("uiNotAssigned"); else - keyName= remapIT->second.Combo.toUCString(); + keyName= remapIT->second.Combo.toString(); const CBaseAction *baseAction = pAM->getBaseAction(remapIT->second.ActionName); if (baseAction) { @@ -492,7 +492,7 @@ void CModalContainerEditCmd::activate() } if (found) { - pCB->addText(CI18N::get(rVCat[i].LocalizedName).toUtf8()); + pCB->addText(CI18N::get(rVCat[i].LocalizedName)); CurrentEditCmdCategories.push_back(rVCat[i].Name); } } @@ -689,7 +689,7 @@ void CModalContainerEditCmd::activateFrom (const std::string &cmdName, const std if (noParam == 0) sText = WinName+VIEW_EDITCMD_FIRST_PARAM_NAME; else sText = WinName+VIEW_EDITCMD_SECOND_PARAM_NAME; CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sText)); - if (pVT != NULL) pVT->setText(CI18N::get(pBA->Parameters[i].LocalizedName).toUtf8()); + if (pVT != NULL) pVT->setText(CI18N::get(pBA->Parameters[i].LocalizedName)); noParam++; } } @@ -711,7 +711,7 @@ void CModalContainerEditCmd::activateFrom (const std::string &cmdName, const std CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+VIEW_EDITCMD_TEXT_KEY)); if (pVT != NULL) pVT->setActive(true); // setup the text of the key - pVT->setText(it->second.toUCString().toUtf8()); + pVT->setText(it->second.toString()); // There is already a shortcut so we can display ok button pBut = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+CTRL_EDITCMD_BUTTON_OK)); @@ -778,7 +778,7 @@ void CModalContainerEditCmd::invalidCurrentCommand() { // Dont display key shortcut if we are in creation mode pVT= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( WinName+VIEW_EDITCMD_TEXT_KEY )); - if (pVT != NULL) pVT->setText(CI18N::get(VIEW_EDITCMD_TEXT_KEY_DEFAULT).toUtf8()); + if (pVT != NULL) pVT->setText(CI18N::get(VIEW_EDITCMD_TEXT_KEY_DEFAULT)); // Deactivate the key definer text pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+VIEW_EDITCMD_TEXT_KEY)); @@ -887,7 +887,7 @@ void CModalContainerEditCmd::validCurrentCommand() { CurrentEditCmdLine.Combo = it->second; // Yes ok let setup the text of the key - pVT->setText(it->second.toUCString().toUtf8()); + pVT->setText(it->second.toString()); // There is already a shortcut so we can display ok button CCtrlBaseButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+CTRL_EDITCMD_BUTTON_OK)); if (pCB != NULL) pCB->setFrozen (false); @@ -897,7 +897,7 @@ void CModalContainerEditCmd::validCurrentCommand() CurrentEditCmdLine.Combo.Key = KeyCount; CurrentEditCmdLine.Combo.KeyButtons = noKeyButton; // Display not assigned text - pVT->setText(CI18N::get(VIEW_EDITCMD_TEXT_KEY_DEFAULT).toUtf8()); + pVT->setText(CI18N::get(VIEW_EDITCMD_TEXT_KEY_DEFAULT)); // Do not display the ok button CCtrlBaseButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+CTRL_EDITCMD_BUTTON_OK)); if (pCB != NULL) pCB->setFrozen (true); @@ -1033,7 +1033,7 @@ void CModalContainerEditCmd::onChangeCategory() { if (rBA.isUsableInCurrentContext()) { - pCB->addText(CI18N::get(rBA.LocalizedName).toUtf8()); + pCB->addText(CI18N::get(rBA.LocalizedName)); } } } @@ -1111,7 +1111,7 @@ void CModalContainerEditCmd::onChangeAction() pViewParamName = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sViewText)); if (pViewParamName != NULL) - pViewParamName->setText (CI18N::get(rP.LocalizedName).toUtf8()); + pViewParamName->setText (CI18N::get(rP.LocalizedName)); } if (rP.Type == CBaseAction::CParameter::Constant) @@ -1131,7 +1131,7 @@ void CModalContainerEditCmd::onChangeAction() if (ActionsContext.matchContext(rVal.Contexts)) { if (NLMISC::startsWith(rVal.LocalizedValue, "ui")) - pCB->addText(CI18N::get(rVal.LocalizedValue).toUtf8()); + pCB->addText(CI18N::get(rVal.LocalizedValue)); else pCB->addText(rVal.LocalizedValue); } @@ -1353,7 +1353,7 @@ public: pMCM->NewKey->CurrentEditCmdLine.Combo = pGetKey->Combo; CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(pMCM->NewKey->WinName+VIEW_EDITCMD_TEXT_KEY)); - if (pVT != NULL) pVT->setText(pMCM->NewKey->CurrentEditCmdLine.Combo.toUCString().toUtf8()); + if (pVT != NULL) pVT->setText(pMCM->NewKey->CurrentEditCmdLine.Combo.toString()); CCtrlBaseButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(pMCM->NewKey->WinName+CTRL_EDITCMD_BUTTON_OK)); if (pCB != NULL) pCB->setFrozen (false); @@ -1365,7 +1365,7 @@ public: pMCM->EditCmd->CurrentEditCmdLine.Combo = pGetKey->Combo; pMCM->CurrentEditMacro.Combo = pMCM->EditCmd->CurrentEditCmdLine.Combo; CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(VIEW_NEWMACRO_KEY)); - if (pVT != NULL) pVT->setText(pMCM->EditCmd->CurrentEditCmdLine.Combo.toUCString().toUtf8()); + if (pVT != NULL) pVT->setText(pMCM->EditCmd->CurrentEditCmdLine.Combo.toString()); } } }; diff --git a/ryzom/client/src/interface_v3/macrocmd_manager.cpp b/ryzom/client/src/interface_v3/macrocmd_manager.cpp index 12b066fff..d097ec239 100644 --- a/ryzom/client/src/interface_v3/macrocmd_manager.cpp +++ b/ryzom/client/src/interface_v3/macrocmd_manager.cpp @@ -895,9 +895,9 @@ public: if (pVT != NULL) { if (pMCM->CurrentEditMacro.Combo.Key == KeyCount) - pVT->setText(CI18N::get(VIEW_EDITCMD_TEXT_KEY_DEFAULT).toUtf8()); + pVT->setText(CI18N::get(VIEW_EDITCMD_TEXT_KEY_DEFAULT)); else - pVT->setText(pMCM->CurrentEditMacro.Combo.toUCString().toUtf8()); + pVT->setText(pMCM->CurrentEditMacro.Combo.toString()); } pList->clearGroups(); @@ -1003,9 +1003,9 @@ void addMacroLine (CGroupList *pParent, uint macNb, const CMacroCmd ¯o) if (pVT != NULL) { if (macro.Combo.Key != KeyCount) - pVT->setText(macro.Combo.toUCString().toUtf8()); + pVT->setText(macro.Combo.toString()); else - pVT->setText(CI18N::get(VIEW_EDITCMD_TEXT_KEY_DEFAULT).toUtf8()); + pVT->setText(CI18N::get(VIEW_EDITCMD_TEXT_KEY_DEFAULT)); } pNewMacro->setParent (pParent); diff --git a/ryzom/client/src/interface_v3/music_player.cpp b/ryzom/client/src/interface_v3/music_player.cpp index a0a7aed66..f7f9e05f2 100644 --- a/ryzom/client/src/interface_v3/music_player.cpp +++ b/ryzom/client/src/interface_v3/music_player.cpp @@ -492,7 +492,7 @@ void CMusicPlayer::clearPlayingInfo() { if (_Songs.empty()) { - updatePlayingInfo(CI18N::get("uiNoFiles").toUtf8()); + updatePlayingInfo(CI18N::get("uiNoFiles")); } else { @@ -632,7 +632,7 @@ void CMusicPlayer::createPlaylistFromMusic() join(extensions, ", ", extlist); extlist += ", m3u, m3u8"; - std::string msg(CI18N::get("uiMk_system6").toUtf8()); + std::string msg(CI18N::get("uiMk_system6")); msg += ": " + newPath + " (" + extlist + ")"; CInterfaceManager::getInstance()->displaySystemInfo(ucstring::makeFromUtf8(msg), "SYS"); nlinfo("%s", msg.c_str()); diff --git a/ryzom/client/src/interface_v3/people_interraction.cpp b/ryzom/client/src/interface_v3/people_interraction.cpp index e285bbaf9..3d23e31f2 100644 --- a/ryzom/client/src/interface_v3/people_interraction.cpp +++ b/ryzom/client/src/interface_v3/people_interraction.cpp @@ -2593,7 +2593,7 @@ public: { for(uint l = 0; l < pl.PartyChats.size(); ++l) { - menu->addLineAtIndex(insertionIndex, pl.PartyChats[l].Window->getTitle(), "chat_target_selected", toString(pl.PartyChats[l].ID)); + menu->addLineAtIndex(insertionIndex, pl.PartyChats[l].Window->getTitle().toUtf8(), "chat_target_selected", toString(pl.PartyChats[l].ID)); ++ insertionIndex; } } @@ -2640,8 +2640,8 @@ public: STRING_MANAGER::CStringManagerClient::instance()->getDynString(textId, title); // replace dynamic channel name and shortcut - ucstring res = CI18N::get("uiFilterMenuDynamic"); - strFindReplace(res, "%channel", title); + string res = CI18N::get("uiFilterMenuDynamic"); + strFindReplace(res, "%channel", title.toUtf8()); strFindReplace(res, "%shortcut", s); pMenu->addLineAtIndex(5 + insertion_index, res, "chat_target_selected", "dyn"+s, "dyn"+s); @@ -2940,7 +2940,7 @@ class CHandlerSelectChatSource : public IActionHandler { if (pc[l].Filter != NULL) { - menu->addLineAtIndex(insertionIndex, pc[l].Window->getTitle(), FILTER_TOGGLE, toString(pc[l].ID)); + menu->addLineAtIndex(insertionIndex, pc[l].Window->getTitle().toUtf8(), FILTER_TOGGLE, toString(pc[l].ID)); menu->setUserGroupLeft(insertionIndex, createMenuCheckBox(FILTER_TOGGLE, toString(pc[l].ID), pc[l].Filter->isListeningWindow(cw))); ++ insertionIndex; } @@ -2956,7 +2956,7 @@ class CHandlerSelectChatSource : public IActionHandler { ucstring title; STRING_MANAGER::CStringManagerClient::instance()->getDynString(textId, title); - menu->addLineAtIndex(insertionIndex, "["+s+"] " + title, FILTER_TOGGLE, "dyn"+s); + menu->addLineAtIndex(insertionIndex, "["+s+"] " + title.toUtf8(), FILTER_TOGGLE, "dyn"+s); menu->setUserGroupLeft(insertionIndex, createMenuCheckBox(FILTER_TOGGLE, "dyn"+s, pi.ChatInput.DynamicChat[i].isListeningWindow(cw))); ++insertionIndex; } diff --git a/ryzom/client/src/interface_v3/people_list.cpp b/ryzom/client/src/interface_v3/people_list.cpp index 1b4c7ea5e..30a468975 100644 --- a/ryzom/client/src/interface_v3/people_list.cpp +++ b/ryzom/client/src/interface_v3/people_list.cpp @@ -471,14 +471,14 @@ void CPeopleList::displayLocalPlayerTell(const ucstring &receiver, uint index, c return; } - ucstring csr(CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : ""); - ucstring finalMsg = csr + CI18N::get("youTell") + ": " + msg; + string csr = CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : ""; + string finalMsg = csr + CI18N::get("youTell") + ": " + msg.toUtf8(); // display msg with good color CInterfaceProperty prop; prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," "); - ucstring s = CI18N::get("youTellPlayer"); - strFindReplace(s, "%name", receiver); + string s = CI18N::get("youTellPlayer"); + strFindReplace(s, "%name", receiver.toUtf8()); strFindReplace(finalMsg, CI18N::get("youTell"), s); gl->addChild(getChatTextMngr().createMsgText(finalMsg, prop.getRGBA())); CInterfaceManager::getInstance()->log(finalMsg, CChatGroup::groupTypeToString(CChatGroup::tell)); @@ -876,7 +876,7 @@ class CHandlerContactEntry : public IActionHandler { CGroupEditBox *pEB = dynamic_cast(pCaller); if (pEB == NULL) return; - ucstring text = pEB->getInputStringAsUtf16(); + string text = pEB->getInputString(); // If the line is empty, do nothing if(text.empty()) return; @@ -892,8 +892,7 @@ class CHandlerContactEntry : public IActionHandler if(text[0] == '/') { CChatWindow::_ChatWindowLaunchingCommand = NULL; // no CChatWindow instance there .. - // TODO : have NLMISC::ICommand accept unicode strings - std::string str = text.toUtf8().substr(1); + std::string str = text.substr(1); NLMISC::ICommand::execute( str, g_log ); pEB->setInputString (std::string()); return; @@ -904,10 +903,10 @@ class CHandlerContactEntry : public IActionHandler CGroupContainer *gc = static_cast< CGroupContainer* >( pCaller->getParent()->getEnclosingContainer() ); // title gives the name of the player - ucstring playerName = gc->getUCTitle(); + string playerName = gc->getUCTitle().toUtf8(); // Simply do a tell on the player - ChatMngr.tell(playerName.toString(), text); + ChatMngr.tell(playerName, text); pEB->setInputString (std::string()); if (gc) { @@ -940,18 +939,18 @@ class CHandlerContactEntry : public IActionHandler CChatGroupWindow *pWin = PeopleInterraction.getChatGroupWindow(); CInterfaceProperty prop; prop.readRGBA("UI:SAVE:CHAT:COLORS:SPEAKER"," "); - ucstring final; + string final; CChatWindow::encodeColorTag(prop.getRGBA(), final, false); - ucstring csr(CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : ""); + string csr(CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : ""); final += csr + CI18N::get("youTell")+": "; prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," "); CChatWindow::encodeColorTag(prop.getRGBA(), final, true); final += text; pWin->displayTellMessage(final, prop.getRGBA(), pWin->getFreeTellerName(str)); - ucstring s = CI18N::get("youTellPlayer"); - strFindReplace(s, "%name", pWin->getFreeTellerName(str)); + string s = CI18N::get("youTellPlayer"); + strFindReplace(s, "%name", pWin->getFreeTellerName(str).toUtf8()); strFindReplace(final, CI18N::get("youTell"), s); CInterfaceManager::getInstance()->log(final, CChatGroup::groupTypeToString(CChatGroup::tell)); } diff --git a/ryzom/client/src/interface_v3/skill_manager.cpp b/ryzom/client/src/interface_v3/skill_manager.cpp index 505678f3d..24a018e94 100644 --- a/ryzom/client/src/interface_v3/skill_manager.cpp +++ b/ryzom/client/src/interface_v3/skill_manager.cpp @@ -588,7 +588,7 @@ void CSkillManager::checkTitleUnblocked(CHARACTER_TITLE::ECharacterTitle i, bool string titleStr = CHARACTER_TITLE::toString((CHARACTER_TITLE::ECharacterTitle)i); bool womenTitle = (UserEntity && UserEntity->getGender() == GSGENDER::female); const ucstring newtitle(CStringManagerClient::getTitleLocalizedName(titleStr, womenTitle)); - CAHManager::getInstance()->runActionHandler("message_popup", NULL, "text1="+newtitle.toUtf8()+"|text0="+CI18N::get("uiNewTitleBold").toUtf8()); + CAHManager::getInstance()->runActionHandler("message_popup", NULL, "text1="+newtitle.toUtf8()+"|text0="+CI18N::get("uiNewTitleBold")); } else { diff --git a/ryzom/client/src/interface_v3/task_bar_manager.cpp b/ryzom/client/src/interface_v3/task_bar_manager.cpp index 7c9bb2a45..35f27b07d 100644 --- a/ryzom/client/src/interface_v3/task_bar_manager.cpp +++ b/ryzom/client/src/interface_v3/task_bar_manager.cpp @@ -180,9 +180,9 @@ public: if (pVT != NULL) { if (it != acmap.end()) - pVT->setText(it->second.toUCString().toUtf8()); + pVT->setText(it->second.toString()); else - pVT->setText(CI18N::get("uiNotAssigned").toUtf8()); + pVT->setText(CI18N::get("uiNotAssigned")); } } } diff --git a/ryzom/client/src/login_patch.cpp b/ryzom/client/src/login_patch.cpp index 926ed61b1..3d7a8a4c8 100644 --- a/ryzom/client/src/login_patch.cpp +++ b/ryzom/client/src/login_patch.cpp @@ -1931,9 +1931,9 @@ int CPatchManager::validateProgress(void *foo, double t, double d, double /* ult if (units.empty()) { - units.push_back(CI18N::get("uiByte").toUtf8()); - units.push_back(CI18N::get("uiKb").toUtf8()); - units.push_back(CI18N::get("uiMb").toUtf8()); + units.push_back(CI18N::get("uiByte")); + units.push_back(CI18N::get("uiKb")); + units.push_back(CI18N::get("uiMb")); } CPatchManager *pPM = CPatchManager::getInstance(); diff --git a/ryzom/client/src/main_loop_debug.cpp b/ryzom/client/src/main_loop_debug.cpp index ac29a3984..7c63d9502 100644 --- a/ryzom/client/src/main_loop_debug.cpp +++ b/ryzom/client/src/main_loop_debug.cpp @@ -714,9 +714,9 @@ static std::string getActionKey(const char* name, const char* param = "") CActionsManager::TActionComboMap::const_iterator ite = acmap.find(CAction::CName(name, param)); if (ite != acmap.end()) - return ite->second.toUCString().toString(); + return ite->second.toString(); - return CI18N::get("uiNotAssigned").toString(); + return CI18N::get("uiNotAssigned"); } //--------------------------------------------------- diff --git a/ryzom/client/src/net_manager.cpp b/ryzom/client/src/net_manager.cpp index afbc26a63..dae3c2848 100644 --- a/ryzom/client/src/net_manager.cpp +++ b/ryzom/client/src/net_manager.cpp @@ -614,23 +614,23 @@ static CInterfaceChatDisplayer InterfaceChatDisplayer; void CInterfaceChatDisplayer::colorizeSender(ucstring &text, const ucstring &senderName, CRGBA baseColor) { // find the sender/text separator to put color tags - ucstring::size_type pos = senderName.length() - 1; + ucstring::size_type pos = senderName.toUtf8().length() - 1; if (pos != ucstring::npos) { - ucstring str; + string str; CInterfaceProperty prop; prop.readRGBA("UI:SAVE:CHAT:COLORS:SPEAKER"," "); CChatWindow::encodeColorTag(prop.getRGBA(), str, false); - str += text.substr(0, pos+1); + str += text.toUtf8().substr(0, pos+1); CChatWindow::encodeColorTag(baseColor, str, true); - str += text.substr(pos+1); + str += text.toUtf8().substr(pos+1); - text.swap(str); + text.fromUtf8(str); } } diff --git a/ryzom/client/src/progress.cpp b/ryzom/client/src/progress.cpp index 133f5abd2..48d642aea 100644 --- a/ryzom/client/src/progress.cpp +++ b/ryzom/client/src/progress.cpp @@ -354,12 +354,12 @@ void CProgress::internalProgress (float value) // Print some more info uint32 day = RT.getRyzomDay(); - str = toString (CI18N::get ("uiTipsTeleport").toUtf8().c_str(), - CI18N::get (LoadingContinent->LocalizedName).toUtf8().c_str(), + str = toString (CI18N::get ("uiTipsTeleport").c_str(), + CI18N::get (LoadingContinent->LocalizedName).c_str(), day, (uint)RT.getRyzomTime(), - CI18N::get ("uiSeason"+toStringEnum(CRyzomTime::getSeasonByDay(day))).toUtf8().c_str(), - CI18N::get (WeatherManager.getCurrWeatherState().LocalizedName).toUtf8().c_str()); + CI18N::get ("uiSeason"+toStringEnum(CRyzomTime::getSeasonByDay(day))).c_str(), + CI18N::get (WeatherManager.getCurrWeatherState().LocalizedName).c_str()); ucstring ucstr; ucstr.fromUtf8 (str); TextContext->setHotSpot(UTextContext::MiddleBottom); diff --git a/ryzom/client/src/r2/auto_group.cpp b/ryzom/client/src/r2/auto_group.cpp index 7372d6e48..7bbeb39d3 100644 --- a/ryzom/client/src/r2/auto_group.cpp +++ b/ryzom/client/src/r2/auto_group.cpp @@ -281,7 +281,7 @@ void CAutoGroup::group(CObject *newEntityDesc, const NLMISC::CVectorD &createPos R2::getEditor().getEnv()["PaletteIdToGroupTranslation"][newEntityDesc->getAttr("Base")->toString()].push(); if (ls.isString(-1)) readableName.fromUtf8(ls.toString(-1)); - ucstring ucGroupName = ucstring(readableName + " " + CI18N::get("uiR2EDNameGroup").toUtf8()); + ucstring ucGroupName = ucstring(readableName + " " + CI18N::get("uiR2EDNameGroup")); newGroup->set("Name", getEditor().genInstanceName(ucGroupName).toUtf8()); getEditor().getDMC().requestInsertNode(destGroup->getParentAct()->getId(), diff --git a/ryzom/client/src/r2/displayer_visual_entity.cpp b/ryzom/client/src/r2/displayer_visual_entity.cpp index 6e09e580e..344d2a8fa 100644 --- a/ryzom/client/src/r2/displayer_visual_entity.cpp +++ b/ryzom/client/src/r2/displayer_visual_entity.cpp @@ -994,7 +994,7 @@ void CDisplayerVisualEntity::updateName() } std::string firstPart; if(actNb>0) - firstPart = CI18N::get("uiR2EDDefaultActTitle").toString() + " " + NLMISC::toString(actNb); + firstPart = CI18N::get("uiR2EDDefaultActTitle") + " " + NLMISC::toString(actNb); if (act->isString("Name")) actName = act->toString("Name"); @@ -1006,7 +1006,7 @@ void CDisplayerVisualEntity::updateName() } else { - actName = CI18N::get("uiR2EDBaseAct").toString(); + actName = CI18N::get("uiR2EDBaseAct"); } actName = NLMISC::toString(" [%s]", actName.c_str()); diff --git a/ryzom/client/src/r2/displayer_visual_group.cpp b/ryzom/client/src/r2/displayer_visual_group.cpp index 0edc18880..5cf2c542d 100644 --- a/ryzom/client/src/r2/displayer_visual_group.cpp +++ b/ryzom/client/src/r2/displayer_visual_group.cpp @@ -73,10 +73,10 @@ public: return CCtrlPolygon::contains(CVector2f(mouseXInWindow + 0.5f, mouseYInWindow + 0.5f)); } // tooltip - virtual void getContextHelp(::ucstring &help) const + virtual void getContextHelp(std::string &help) const { - help = Instance.getDisplayName(); - if (std::operator==(help, NLMISC::CI18N::get("uiR2EDNoName") )) + help = Instance.getDisplayName().toUtf8(); + if (help == NLMISC::CI18N::get("uiR2EDNoName")) help.clear(); } bool emptyContextHelp() const { return true; } @@ -122,10 +122,10 @@ public: return CCtrlQuad::contains(CVector2f(mouseXInWindow + 0.5f, mouseYInWindow + 0.5f)); } // tooltip - virtual void getContextHelp(ucstring &help) const + virtual void getContextHelp(std::string &help) const { - help = Instance.getDisplayName(); - if (std::operator==(help, NLMISC::CI18N::get("uiR2EDNoName"))) + help = Instance.getDisplayName().toUtf8(); + if (help == NLMISC::CI18N::get("uiR2EDNoName")) help.clear(); } bool emptyContextHelp() const { return true; } diff --git a/ryzom/client/src/r2/editor.cpp b/ryzom/client/src/r2/editor.cpp index e863d27ff..43d8c90f4 100644 --- a/ryzom/client/src/r2/editor.cpp +++ b/ryzom/client/src/r2/editor.cpp @@ -1761,7 +1761,7 @@ void CEditor::waitScenarioScreen() // Display the firewall alert string CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:r2ed_connecting:title")); if (pVT != NULL) - pVT->setText(CI18N::get("uiFirewallAlert").toUtf8()+"..."); + pVT->setText(CI18N::get("uiFirewallAlert")+"..."); // The mouse and fullscreen mode should be unlocked for the user to set the firewall permission nlSleep( 30 ); // 'nice' the client, and prevent to make too many send attempts @@ -1853,8 +1853,8 @@ void CEditor::waitScenarioScreen() if (pVT != NULL) { pVT->setMultiLine( true ); - pVT->setText(CI18N::get("uiFirewallFail").toUtf8()+".\n"+ - CI18N::get("uiFirewallAlert").toUtf8()+"."); + pVT->setText(CI18N::get("uiFirewallFail")+".\n"+ + CI18N::get("uiFirewallAlert")+"."); } } } @@ -6468,7 +6468,7 @@ void CEditor::connectionMsg(const std::string &stringId) CViewText *vt = dynamic_cast(r2ConnectWindow->getView("connexionMsg")); if (vt) { - vt->setText(CI18N::get(stringId).toUtf8()); + vt->setText(CI18N::get(stringId)); } } } @@ -7497,7 +7497,7 @@ class CAHInviteCharacter : public IActionHandler { CViewText* pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text")); if (pVT != NULL) - pVT->setText(CI18N::get("uiRingWarningInviteFreeTrial").toUtf8()); + pVT->setText(CI18N::get("uiRingWarningInviteFreeTrial")); CAHManager::getInstance()->runActionHandler("enter_modal", pCaller, "group=ui:interface:warning_free_trial"); } diff --git a/ryzom/client/src/r2/instance_map_deco.cpp b/ryzom/client/src/r2/instance_map_deco.cpp index cdc792dc5..ae3857990 100644 --- a/ryzom/client/src/r2/instance_map_deco.cpp +++ b/ryzom/client/src/r2/instance_map_deco.cpp @@ -40,11 +40,12 @@ namespace R2 { // ********************************************************************************************************* -void CInstanceMapDeco::CCtrlButtonEntity::getContextHelp(ucstring &help) const +void CInstanceMapDeco::CCtrlButtonEntity::getContextHelp(std::string &help) const { //H_AUTO(R2_CCtrlButtonEntity_getContextHelp) - help = _Instance.getDisplayName(); - if (help == NLMISC::CI18N::get("uiR2EDNoName")) help.clear(); + help = _Instance.getDisplayName().toUtf8(); + if (help == NLMISC::CI18N::get("uiR2EDNoName")) + help.clear(); } // ********************************************************************************************************* diff --git a/ryzom/client/src/r2/instance_map_deco.h b/ryzom/client/src/r2/instance_map_deco.h index cf1a2352c..9be099c19 100644 --- a/ryzom/client/src/r2/instance_map_deco.h +++ b/ryzom/client/src/r2/instance_map_deco.h @@ -91,7 +91,7 @@ private: private: CInstance &_Instance; protected: - virtual void getContextHelp(ucstring &help) const; + virtual void getContextHelp(std::string &help) const; bool emptyContextHelp() const { return true; } bool wantInstantContextHelp() const { return true; } virtual bool isCapturable() const { return false; } diff --git a/ryzom/client/src/r2/tool_select_move.cpp b/ryzom/client/src/r2/tool_select_move.cpp index f9b9b9a1a..d16b45ced 100644 --- a/ryzom/client/src/r2/tool_select_move.cpp +++ b/ryzom/client/src/r2/tool_select_move.cpp @@ -417,9 +417,9 @@ void CToolSelectMove::commitAction(CInstance &instance) } else { - ucstring instanceName = instance.getDisplayName(); + string instanceName = instance.getDisplayName().toUtf8(); if(instanceName == CI18N::get("uiR2EDNoName")) - instanceName = ucstring(instance.getClassName()); + instanceName = instance.getClassName(); //getDMC().newAction(CI18N::get("uiR2EDMoveAction") + instance.getDisplayName()); getDMC().newAction(CI18N::get("uiR2EDMoveAction") + instanceName); diff --git a/ryzom/client/src/session_browser_impl.cpp b/ryzom/client/src/session_browser_impl.cpp index f11c24a54..9f3cc77a9 100644 --- a/ryzom/client/src/session_browser_impl.cpp +++ b/ryzom/client/src/session_browser_impl.cpp @@ -230,7 +230,7 @@ int CSessionBrowserImpl::luaJoinRingSession(CLuaState &ls) { CViewText* pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text")); if (pVT != NULL) - pVT->setText(CI18N::get("uiRingWarningFreeTrial").toUtf8()); + pVT->setText(CI18N::get("uiRingWarningFreeTrial")); CAHManager::getInstance()->runActionHandler("enter_modal", NULL, "group=ui:interface:warning_free_trial"); } diff --git a/ryzom/client/src/string_manager_client.h b/ryzom/client/src/string_manager_client.h index 8eeafa292..28e57af5f 100644 --- a/ryzom/client/src/string_manager_client.h +++ b/ryzom/client/src/string_manager_client.h @@ -60,6 +60,7 @@ public: // Force the cache to be saved void flushStringCache(); + bool getString(uint32 stringId, std::string &result) { ucstring temp; bool res = getString(stringId, temp); result = temp.toUtf8(); return res; } // FIXME: UTF-8 bool getString(uint32 stringId, ucstring &result); void waitString(uint32 stringId, const IStringWaiterRemover *premover, ucstring *result); void waitString(uint32 stringId, IStringWaitCallback *pcallback); diff --git a/ryzom/common/src/game_share/rm_family.cpp b/ryzom/common/src/game_share/rm_family.cpp index a45793aad..5351b00b7 100644 --- a/ryzom/common/src/game_share/rm_family.cpp +++ b/ryzom/common/src/game_share/rm_family.cpp @@ -118,7 +118,7 @@ namespace RM_FABER_TYPE } /// Client: use the CI18N - const ucstring& toLocalString( TRMFType e ) + const std::string& toLocalString( TRMFType e ) { return CI18N::get("mpft" + toString(e)); } @@ -134,7 +134,7 @@ namespace RM_FABER_TYPE namespace RM_FAMILY { /// Get the Localized UCString - const ucstring& toLocalString( TRMFamily e ) + const std::string& toLocalString( TRMFamily e ) { return CI18N::get("mpfam" + toString(e)); } @@ -144,7 +144,7 @@ namespace RM_FAMILY namespace RM_GROUP { /// Get the Localized UCString - const ucstring& toLocalString( TRMGroup e ) + const std::string& toLocalString( TRMGroup e ) { return CI18N::get("mpgroup" + toString(e)); } @@ -154,7 +154,7 @@ namespace RM_GROUP namespace RM_FABER_PROPERTY { /// Get the Localized UCString - const ucstring& toLocalString( TRMFProperty e ) + const std::string& toLocalString( TRMFProperty e ) { return CI18N::get("mpprop" + toString(e)); } @@ -188,7 +188,7 @@ namespace RM_FABER_QUALITY } /// Client: use the CI18N - const ucstring& toLocalString( TFaberQuality e ) + const std::string& toLocalString( TFaberQuality e ) { return CI18N::get("mpfq" + toString(e)); } @@ -224,7 +224,7 @@ namespace RM_COLOR } /// Get the Localized UCString - const ucstring& toLocalString( sint value ) + const std::string& toLocalString( sint value ) { return CI18N::get("mpcol" + toString(value)); } @@ -283,7 +283,7 @@ namespace RM_FABER_STAT_TYPE return conversion.toString(stats); } - const ucstring& toLocalString( TRMStatType stats ) + const std::string& toLocalString( TRMStatType stats ) { // must change en.uxt nlctassert(NumRMStatType == sizeof(stringTable)/sizeof(stringTable[0])); @@ -663,9 +663,9 @@ namespace RM_FABER_STAT_TYPE namespace RM_CLASS_TYPE { -const ucstring &toLocalString(TRMClassType classType) +const std::string &toLocalString(TRMClassType classType) { - return CI18N::get(toString("uiItemRMClass%d", classType).c_str()); + return CI18N::get(toString("uiItemRMClass%d", classType)); } diff --git a/ryzom/common/src/game_share/rm_family.h b/ryzom/common/src/game_share/rm_family.h index a69a51517..9f9048531 100644 --- a/ryzom/common/src/game_share/rm_family.h +++ b/ryzom/common/src/game_share/rm_family.h @@ -85,7 +85,7 @@ namespace RM_FABER_TYPE const std::string &faberTypeToSheetEntry(TRMFType type); /// Get the Localized UCString - const ucstring& toLocalString( TRMFType e ); + const std::string& toLocalString( TRMFType e ); /// For Client Interface, return the define name of the type (eg: "item_part_icon_MpL") std::string toIconDefineString( TRMFType e ); @@ -101,7 +101,7 @@ namespace RM_FAMILY const TRMFamily Unknown = 0; /// Get the Localized UCString - const ucstring& toLocalString( TRMFamily e ); + const std::string& toLocalString( TRMFamily e ); /// Debug string inline std::string toString( TRMFamily e ) { return NLMISC::toString(e); } @@ -119,7 +119,7 @@ namespace RM_GROUP const TRMGroup Unknown = 0; /// Get the Localized UCString - const ucstring& toLocalString( TRMGroup e ); + const std::string& toLocalString( TRMGroup e ); // Note: the group names are accessible on server by CMP::rmGroupToString() @@ -138,7 +138,7 @@ namespace RM_FABER_PROPERTY const TRMFProperty Unknown = 0; /// Get the Localized UCString - const ucstring& toLocalString( TRMFProperty e ); + const std::string& toLocalString( TRMFProperty e ); /// Debug string inline std::string toString( TRMFProperty e ) { return NLMISC::toString(e); } @@ -178,7 +178,7 @@ namespace RM_FABER_QUALITY TFaberQuality toFaberQuality( const std::string& str ); /// Get the Localized UCString - const ucstring& toLocalString( TFaberQuality e ); + const std::string& toLocalString( TFaberQuality e ); } @@ -199,7 +199,7 @@ namespace RM_COLOR const std::string& toString( sint value ); /// Get the Localized UCString - const ucstring& toLocalString( sint value ); + const std::string& toLocalString( sint value ); }; @@ -251,7 +251,7 @@ namespace RM_FABER_STAT_TYPE const std::string& toString( TRMStatType stats ); /// Get the Localized UCString - const ucstring& toLocalString( TRMStatType stats ); + const std::string& toLocalString( TRMStatType stats ); /// For each Raw material faber type, does this Stat is relevant? bool isStatRelevant(RM_FABER_TYPE::TRMFType ft, TRMStatType fs); @@ -309,7 +309,7 @@ namespace RM_CLASS_TYPE }; /// Get the Localized UCString - const ucstring& toLocalString( TRMClassType classType ); + const std::string& toLocalString( TRMClassType classType ); /// return the item class for a given stat energy [0..100] inline TRMClassType getItemClass(uint32 energy) diff --git a/ryzom/common/src/game_share/roles.cpp b/ryzom/common/src/game_share/roles.cpp index 57ccfdcd4..578096b44 100644 --- a/ryzom/common/src/game_share/roles.cpp +++ b/ryzom/common/src/game_share/roles.cpp @@ -73,7 +73,7 @@ ERole toRoleId( const std::string& Role ) } // Return the Translated name of the Job -const ucstring &roleToUCString (ERole r) +const std::string &roleToUCString(ERole r) { return NLMISC::CI18N::get( toString( r ) ); } diff --git a/ryzom/common/src/game_share/roles.h b/ryzom/common/src/game_share/roles.h index 9164a3254..8b6dfd5b2 100644 --- a/ryzom/common/src/game_share/roles.h +++ b/ryzom/common/src/game_share/roles.h @@ -60,7 +60,7 @@ const std::string& toString( ERole r ); ERole toRoleId( const std::string& Role ); // Return the Translated name of the Job -const ucstring &roleToUCString (ERole r); +const std::string &roleToUCString (ERole r); } // ROLES