Sign in to follow this  
Followers 0
Suppir

RichEdit. Problem with cyrillic characters

4 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Maybe this works?

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

Edit: No, it doesnt seem so :), I'll take a deeper look.

Edited by KaFu

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Maybe somebody knows - is there another UDF that support RichEdit functions (formating, fonts & tables)?

Share this post


Link to post
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
Sign in to follow this  
Followers 0