Jump to content

RichEdit. Problem with cyrillic characters


Suppir
 Share

Recommended Posts

Hello!

I'm using the code:

$Text = _GUICtrlRichEdit_StreamToVar($hRichEdit)

# this replace is working
$Text = StringRegExpReplace($Text, "some latin characters", "some latin characters")  

# this replace is not working!
$Text = StringRegExpReplace($Text, "some cyrillic characters", "some cyrillic characters")

_GuiCtrlRichEdit_SetText($hRichEdit, "")
_GUICtrlRichEdit_StreamFromVar($hRichEdit, $Text)

I'm getting my cyrillic characters from the file with ANSI encoding (CP-1251).

They are displayed in richedit correctly, but the replace does now work :)

I think the problem is in _GUICtrlRichEdit_StreamToVar() function.

Edited by Suppir
Link to comment
Share on other sites

Link to comment
Share on other sites

Maybe this works?

$Text = _GUICtrlRichEdit_StreamToVar($hRichEdit,True,True,$SF_UNICODE)

It returns "False" :)

It is possible to write $iCodePage in parametres, but I do not understand how to do it correctly.

It is a kind of magic. If I use

$Text = _GUICtrlRichEdit_GetCtrlText($hRichEdit)

then cyrillic replaces correctly. But _GUICtrlRichEdit_GetCtrlText() can not transfer MS Word' tables safely.

If I use

$Text = _GUICtrlRichEdit_StreamToVar($hRichEdit)

then MS Word' tables transferes safely, but replaces in cyrillic do not work!

Edited by Suppir
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...