RTF paste problem

General TRichView support forum. Please post your questions here
Post Reply
JSH2
Posts: 7
Joined: Sat Apr 21, 2007 12:27 pm

RTF paste problem

Post by JSH2 »

I am using Korean version Windows.

When I copy & paste korean characters from the NotePad to a RichViewEdit, it is O.K.
But when I copy and paste korean characters from the WordPad or the MS word, it is something wrong.
The pasted korean characters looks well, but the RichView cursor does not move by one character. Twice arrow key stroke move one korean character. And if I delete one Korean character, the character is broken and appears another strange character. If I delete twice, one korean characte is deleted.

This situation occures when the RTFReadProperties.TextStyleMode property is set to rvrsUseClosest or rvrsAddIfNeeded.
If the RTFReadProperties.TextStyleMode property is set to rvrsUseSpecified, the Copy&Paste from Notepad, WordPad and MS word works well.
(To use unicode, I set the RTFReadProperties.UnicodeMode property to rvruMixed and all TextStyles's Unicode properties to true.)

Is it a bug?
How could I solve this problem?

Thanks in advance.


SeungHo Jung
JSH2
Posts: 7
Joined: Sat Apr 21, 2007 12:27 pm

Post by JSH2 »

I made an experiment to find the reason of the RTF paste problem of Korean chaacters.

After I copy and paste Korean characters from a Wordpad to a RichviewEdit, I check the characters's TextStyle.Unicode property, then it is False.
If I force to set it to true, then the richedit's cursor movement on and the character deletion of the pasted characters are O.K.

I think if the RTFReradPeoperties.TextStyleMode is rvrsAddIfNeeded or rvrsUseClosest, the corresponding Fontinfo's Unicode property is not set to True during paste.

How could I solve my problem?
Sergey Tkachenko
Site Admin
Posts: 17310
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Set rv.RTFReadProperties.UnicodeMode = rvruOnlyUnicode.
rv.RTFReadProperties.TextStyleMode should be rvrsAddIfNeeded for best results.
JSH2
Posts: 7
Joined: Sat Apr 21, 2007 12:27 pm

Post by JSH2 »

Yes, it is solved.

Thank you very much.
Post Reply