From bd78692148b2f12bfb5be060292225a04d284d97 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Tue, 30 Oct 2012 05:50:41 -0700 Subject: [PATCH] Use wxSTC::GetTextRaw rather than converting utf-8 -> wxString -> utf-8 --- aegisub/src/scintilla_text_ctrl.cpp | 2 +- aegisub/src/subs_edit_ctrl.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aegisub/src/scintilla_text_ctrl.cpp b/aegisub/src/scintilla_text_ctrl.cpp index 83bb765ef..3a304554c 100644 --- a/aegisub/src/scintilla_text_ctrl.cpp +++ b/aegisub/src/scintilla_text_ctrl.cpp @@ -50,7 +50,7 @@ int ScintillaTextCtrl::GetUnicodePosition(int pos) { /// @brief Reverse unicode-compatible position int ScintillaTextCtrl::GetReverseUnicodePosition(int pos) { - wxCharBuffer buffer = GetText().utf8_str(); + wxCharBuffer buffer = GetTextRaw(); // Limit position to it if (pos > (signed)buffer.length()) pos = buffer.length(); diff --git a/aegisub/src/subs_edit_ctrl.cpp b/aegisub/src/subs_edit_ctrl.cpp index 9518564dc..345c11d92 100644 --- a/aegisub/src/subs_edit_ctrl.cpp +++ b/aegisub/src/subs_edit_ctrl.cpp @@ -281,7 +281,7 @@ void SubsTextEditCtrl::SetStyles() { void SubsTextEditCtrl::UpdateStyle() { StartStyling(0,255); - std::string text = STD_STR(GetText()); + std::string text = GetTextRaw(); if (!OPT_GET("Subtitle/Highlight/Syntax")->GetBool()) { SetStyling(text.size(), 0);