String to std::string is now always converted to UTF-8.

UICodeEditor and UITextInput copy/paste fix.
This commit is contained in:
Martín Lucas Golini
2020-07-03 16:55:31 -03:00
parent af6cce87cb
commit 16f58f2018
3 changed files with 5 additions and 5 deletions

View File

@@ -579,7 +579,7 @@ String String::fromUtf8( const std::string& utf8String ) {
}
String::operator std::string() const {
return toAnsiString();
return toUtf8();
}
std::string String::toAnsiString( const std::locale& locale ) const {

View File

@@ -1567,11 +1567,11 @@ void UICodeEditor::unindent() {
}
void UICodeEditor::copy() {
getUISceneNode()->getWindow()->getClipboard()->setText( mDoc->getSelectedText() );
getUISceneNode()->getWindow()->getClipboard()->setText( mDoc->getSelectedText().toUtf8() );
}
void UICodeEditor::cut() {
getUISceneNode()->getWindow()->getClipboard()->setText( mDoc->getSelectedText() );
getUISceneNode()->getWindow()->getClipboard()->setText( mDoc->getSelectedText().toUtf8() );
mDoc->deleteSelection();
}

View File

@@ -664,11 +664,11 @@ UITextView* UITextInput::setHintFontStyle( const Uint32& fontStyle ) {
}
void UITextInput::copy() {
getUISceneNode()->getWindow()->getClipboard()->setText( mDoc.getSelectedText() );
getUISceneNode()->getWindow()->getClipboard()->setText( mDoc.getSelectedText().toUtf8() );
}
void UITextInput::cut() {
getUISceneNode()->getWindow()->getClipboard()->setText( mDoc.getSelectedText() );
getUISceneNode()->getWindow()->getClipboard()->setText( mDoc.getSelectedText().toUtf8() );
mDoc.deleteSelection();
}