Chinese Characters become messy code when pasting from MS word.

4 Answers 382 Views
RichTextBox
Huan jia
Top achievements
Rank 1
Iron
Huan jia asked on 14 Jul 2021, 03:12 AM | edited on 14 Jul 2021, 05:43 AM
Chinese Characters become messy codes when pasting from MS word. But it displays properly from web pages or textboxes.
Tanya
Telerik team
commented on 16 Jul 2021, 11:08 AM

Hi Huan jia,

We have logged an issue causing similar behavior related to pasting CJK characters copied from MS Word: RichTextBox: Support import from RTF of multi-byte Unicode characters represented with multiple ANSI characters in the form \'xx. However, the behavior is related to content produced by the older versions of MS Word. Can you please check it in the description of the linked item and let us know if the behavior you are observing is the same? If not, would it be possible to share a sample document showing what is being copied so we can locally test it?

Huan jia
Top achievements
Rank 1
Iron
commented on 19 Jul 2021, 01:35 AM

Tanya, I'm not sure if they are the same issue. I can't upload an attachment in a comment, see the thread below.

4 Answers, 1 is accepted

Sort by
0
Huan jia
Top achievements
Rank 1
Iron
answered on 19 Jul 2021, 01:30 AM
HI,Tanya, My docx file is produced by Office 2019, and  the Sample File is compressed into Sample.zip as  an attachment.
Tanya
Telerik team
commented on 19 Jul 2021, 05:13 PM

Hi Huan jia,

Thank you for sharing the sample document. I have tested it with the latest version of RadRichTextBox and it seems like everything is working as expected. Are you using an older version? If so, I would recommend updating to the latest one so you can use the new features and bug fixes from it. 

I am attaching a picture showing the result I am getting after copy-paste operation between MS Word and RadRichTextBox.

In case you are still experiencing the issue even using the latest version, could you extract the RTF content from the clipboard and share it so I can investigate it? You can achieve that using the CommandExecuting event of RadRichTextBox:

private void RadRichTextBox_CommandExecuting(object sender, CommandExecutingEventArgs e)
{
    if (e.Command is PasteCommand)
    {
        RadDocument documentFromClipboard = ClipboardEx.GetDocument().ToDocument();

        RtfFormatProvider provider = new RtfFormatProvider();
        string rtfContent = provider.Export(documentFromClipboard);
    }
}

Huan jia
Top achievements
Rank 1
Iron
commented on 22 Jul 2021, 01:19 AM

Hi Tanya, i have identified which setting cause the messy code, it is RtfFormatProvider. I upload my demo next thread also.

RadCompositionInitializer.Catalog = new TypeCatalog(
typeof(HtmlFormatProvider),
//typeof(RtfFormatProvider), if i uncomment this line, pasting from MSWord will display Chinese messy code
typeof(DocFormatProvider),
0
Huan jia
Top achievements
Rank 1
Iron
answered on 22 Jul 2021, 01:21 AM
Tanya, this is my demo for RtfFormatProvider causing messy code.
Tanya
Telerik team
commented on 22 Jul 2021, 12:09 PM

Hi Huan jia,

I ran the sample project and copy-pasted the content inside RadRichTextBox. However, I am still unable to observe any issue with that operation. Please, find attached a .gif demonstrating my test. Is there a step I am missing?

Huan jia
Top achievements
Rank 1
Iron
commented on 23 Jul 2021, 01:12 AM | edited

Eh, It is quite strange.
Huan jia
Top achievements
Rank 1
Iron
commented on 23 Jul 2021, 02:11 AM | edited

Hi, Tanya, I extracted the RTF content from the clipboard, i found they are different.
-- Messy codes RTF cotent
{\rtf1\ansi\ansicpg1252\uc1\deff0\deflang1033{\fonttbl{\f0 Verdana;}{\f1 Arial;}}{\colortbl\red0\green0\blue0 ;}{\*\defchp\ltrch\f0\fs24\i0\b0\strike0\cf0\ulc0\ulnone}{\*\defpap\sl276\slmult1\ql\sa180\ltrpar}{\stylesheet{\s0\sqformat\spriority0\ltrch\f0\fs24\i0\b0\strike0\cf0\ulc0\ulnone\sl276\slmult1\ql\sa180\ltrpar Normal;}{\*\ts2\tsrowd\spriority59\trbrdrt\brdrnone\trbrdrb\brdrnone\trbrdrl\brdrnone\trbrdrr\brdrnone\trbrdrh\brdrnone\trbrdrv\brdrnone\trgaph0\trpaddl75\trpaddr75\trpaddt0\trpaddb0\clpadft3\clpadt0\clpadfr3\clpadr0\clpadfl3\clpadl0\clpadfb3\clpadb0\tsvertalt\ltrch\f0\fs24\i0\b0\strike0\cf0\ulc0\ulnone\sl276\slmult1\ql\sa180\ltrpar Table Normal;}}\nouicompat\viewkind4\paperw12240\paperh15840\margl1425\margr1425\margt1425\margb1425\deftab720\sectd\pgwsxn12240\pghsxn15840\marglsxn1425\margrsxn1425\margtsxn1425\margbsxn1425\headery720\footery720\pard\sl276\slmult1\ql\sa180\ltrpar{\ltrch\f1\fs24\i0\b0\strike0\cf0\ulc0\ulnone \u30477?\u-7065?\u-24788??\u-29558??\u-32719??\u-7445??\u-32719??\u-7445??\u31709??\u-27277??\u-7065??\u-24788??\u-29558?\u21721?\u-7065?\u29623?\u-7065?\u29623?\u-29558?\u30477?\u-7255?\u24400?}{\ltrch\f0\fs24\i0\b0\strike0\cf0\ulc0\ulnone\par}}

-- Propery Chinese characters RTF content
{\rtf1\ansi\ansicpg1252\uc1\deff0\deflang1033{\fonttbl{\f0 Verdana;}{\f1 \u31561?\u32447?;}}{\colortbl\red0\green0\blue0 ;}{\*\defchp\ltrch\f0\fs24\i0\b0\strike0\cf0\ulc0\ulnone}{\*\defpap\sl276\slmult1\ql\sa180\ltrpar}{\stylesheet{\s0\sqformat\spriority0\ltrch\f0\fs24\i0\b0\strike0\cf0\ulc0\ulnone\sl276\slmult1\ql\sa180\ltrpar Normal;}{\*\ts2\tsrowd\spriority59\trbrdrt\brdrnone\trbrdrb\brdrnone\trbrdrl\brdrnone\trbrdrr\brdrnone\trbrdrh\brdrnone\trbrdrv\brdrnone\trgaph0\trpaddl75\trpaddr75\trpaddt0\trpaddb0\clpadft3\clpadt0\clpadfr3\clpadr0\clpadfl3\clpadl0\clpadfb3\clpadb0\tsvertalt\ltrch\f0\fs24\i0\b0\strike0\cf0\ulc0\ulnone\sl276\slmult1\ql\sa180\ltrpar Table Normal;}{\s3\spriority99\ltrch\f0\fs24\i0\b0\strike0\cf0\ulc0\ulnone\sl276\slmult1\ql\sb100\sa100\sbauto1\saauto1\ltrpar Normal (Web);}}\nouicompat\viewkind4\paperw12240\paperh15840\margl1425\margr1425\margt1425\margb1425\deftab720\sectd\pgwsxn12240\pghsxn15840\marglsxn1425\margrsxn1425\margtsxn1425\margbsxn1425\headery720\footery720\pard\s3\sl276\slmult1\ql\sb100\sa100\sbauto1\saauto1\ltrpar{\ltrch\f1\fs21\i0\b0\strike0\cf0\ulc0\ulnone \u25151?\u20215?\u22238?\u24402?\u32467?\u26524?\u-32486?\u21518?\u-29217?\u23458?\u23478?\u-29731?\u30475?\u30475?\u29615?\u22659?}{\ltrch\f0\fs24\i0\b0\strike0\cf0\ulc0\ulnone\par}\pard\sl276\slmult1\ql\sa180\ltrpar{\ltrch\f0\fs24\i0\b0\strike0\cf0\ulc0\ulnone\par}}
Tanya
Telerik team
commented on 23 Jul 2021, 10:53 AM

Hi Huan jia,

Indeed, it seems like the content is wrongly interpreted by RtfFormatProvider. Let's try to avoid passing the content to the provider and check the content it tries to import. Can you please execute the following code and let me know the result inside the rtf variable?

private void RadRichTextBox_CommandExecuting(object sender, CommandExecutingEventArgs e)
{
    if (e.Command is PasteCommand)
    {
        string rtf = Clipboard.GetData(DataFormats.Rtf).ToString();
    }
}

Also, how do you obtained the correct RTF? I have tried to reproduce the issue with it but still, the content looks correct after inserting it into RadRichTextBox.

 

Huan jia
Top achievements
Rank 1
Iron
commented on 24 Jul 2021, 11:04 AM | edited

Hi. Tanya, this is my clipboard content, my demonstrating video is a attachment in next thread.

{\rtf1 \ansi \ansicpg936 \deff0 \stshfdbch2 \stshfloch2 \stshfhich2 \deflang2052 \deflangfe2052 {\fonttbl {\f0 \froman \fcharset0 \fprq2 {\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}{\f2 \fnil \fcharset134 \fprq0 {\*\panose 02010600030101010101}\'b5\'c8\'cf\'df{\*\falt \'b5\'c8\'cf\'df};}}{\colortbl;\red0\green0\blue0;\red128\green0\blue0;\red255\green0\blue0;\red0\green128\blue0;\red128\green128\blue0;\red0\green255\blue0;\red255\green255\blue0;\red0\green0\blue128;\red128\green0\blue128;\red0\green128\blue128;\red128\green128\blue128;\red192\green192\blue192;\red0\green0\blue255;\red255\green0\blue255;\red0\green255\blue255;\red255\green255\blue255;}{\stylesheet {\qj \li0 \ri0 \nowidctlpar \aspalpha \aspnum \adjustright \lin0 \rin0 \itap0 \rtlch \fcs1 \af0 \afs22 \ltrch \fcs0 \fs21 \kerning2 \rtlch \alang1025 \ltrch \dbch \af2 \hich \af2 \loch \f2 \lang1033 \langnp1033 \langfe2052 \langfenp2052 \alang1025 \snext0 \sqformat \spriority0 Normal;}}{\*\latentstyles \lsdstimax260 \lsdlockeddef0 \lsdsemihiddendef1 \lsdunhideuseddef1 \lsdqformatdef0 \lsdprioritydef99 {\lsdlockedexcept \lsdpriority99 \lsdlocked0 Normal;\lsdpriority99 \lsdlocked0 heading 1;\lsdpriority99 \lsdlocked0 heading 2;\lsdpriority99 \lsdlocked0 heading 3;\lsdpriority99 \lsdlocked0 heading 4;\lsdpriority99 \lsdlocked0 heading 5;\lsdpriority99 \lsdlocked0 heading 6;\lsdpriority99 \lsdlocked0 heading 7;\lsdpriority99 \lsdlocked0 heading 8;\lsdpriority99 \lsdlocked0 heading 9;\lsdpriority99 \lsdlocked0 index 1;\lsdpriority99 \lsdlocked0 index 2;\lsdpriority99 \lsdlocked0 index 3;\lsdpriority99 \lsdlocked0 index 4;\lsdpriority99 \lsdlocked0 index 5;\lsdpriority99 \lsdlocked0 index 6;\lsdpriority99 \lsdlocked0 index 7;\lsdpriority99 \lsdlocked0 index 8;\lsdpriority99 \lsdlocked0 index 9;\lsdpriority99 \lsdlocked0 toc 1;\lsdpriority99 \lsdlocked0 toc 2;\lsdpriority99 \lsdlocked0 toc 3;\lsdpriority99 \lsdlocked0 toc 4;\lsdpriority99 \lsdlocked0 toc 5;\lsdpriority99 \lsdlocked0 toc 6;\lsdpriority99 \lsdlocked0 toc 7;\lsdpriority99 \lsdlocked0 toc 8;\lsdpriority99 \lsdlocked0 toc 9;\lsdpriority99 \lsdlocked0 Normal Indent;\lsdpriority99 \lsdlocked0 footnote text;\lsdpriority99 \lsdlocked0 annotation text;\lsdpriority99 \lsdlocked0 header;\lsdpriority99 \lsdlocked0 footer;\lsdpriority99 \lsdlocked0 index heading;\lsdpriority99 \lsdlocked0 caption;\lsdpriority99 \lsdlocked0 table of figures;\lsdpriority99 \lsdlocked0 envelope address;\lsdpriority99 \lsdlocked0 envelope return;\lsdpriority99 \lsdlocked0 footnote reference;\lsdpriority99 \lsdlocked0 annotation reference;\lsdpriority99 \lsdlocked0 line number;\lsdpriority99 \lsdlocked0 page number;\lsdpriority99 \lsdlocked0 endnote reference;\lsdpriority99 \lsdlocked0 endnote text;\lsdpriority99 \lsdlocked0 table of authorities;\lsdpriority99 \lsdlocked0 macro;\lsdpriority99 \lsdlocked0 toa heading;\lsdpriority99 \lsdlocked0 List;\lsdpriority99 \lsdlocked0 List Bullet;\lsdpriority99 \lsdlocked0 List Number;\lsdpriority99 \lsdlocked0 List 2;\lsdpriority99 \lsdlocked0 List 3;\lsdpriority99 \lsdlocked0 List 4;\lsdpriority99 \lsdlocked0 List 5;\lsdpriority99 \lsdlocked0 List Bullet 2;\lsdpriority99 \lsdlocked0 List Bullet 3;\lsdpriority99 \lsdlocked0 List Bullet 4;\lsdpriority99 \lsdlocked0 List Bullet 5;\lsdpriority99 \lsdlocked0 List Number 2;\lsdpriority99 \lsdlocked0 List Number 3;\lsdpriority99 \lsdlocked0 List Number 4;\lsdpriority99 \lsdlocked0 List Number 5;\lsdpriority99 \lsdlocked0 Title;\lsdpriority99 \lsdlocked0 Closing;\lsdpriority99 \lsdlocked0 Signature;\lsdpriority99 \lsdlocked0 Default Paragraph Font;\lsdpriority99 \lsdlocked0 Body Text;\lsdpriority99 \lsdlocked0 Body Text Indent;\lsdpriority99 \lsdlocked0 List Continue;\lsdpriority99 \lsdlocked0 List Continue 2;\lsdpriority99 \lsdlocked0 List Continue 3;\lsdpriority99 \lsdlocked0 List Continue 4;\lsdpriority99 \lsdlocked0 List Continue 5;\lsdpriority99 \lsdlocked0 Message Header;\lsdpriority99 \lsdlocked0 Subtitle;\lsdpriority99 \lsdlocked0 Salutation;\lsdpriority99 \lsdlocked0 Date;\lsdpriority99 \lsdlocked0 Body Text First Indent;\lsdpriority99 \lsdlocked0 Body Text First Indent 2;\lsdpriority99 \lsdlocked0 Note Heading;\lsdpriority99 \lsdlocked0 Body Text 2;\lsdpriority99 \lsdlocked0 Body Text 3;\lsdpriority99 \lsdlocked0 Body Text Indent 2;\lsdpriority99 \lsdlocked0 Body Text Indent 3;\lsdpriority99 \lsdlocked0 Block Text;\lsdpriority99 \lsdlocked0 Hyperlink;\lsdpriority99 \lsdlocked0 FollowedHyperlink;\lsdpriority99 \lsdlocked0 Strong;\lsdpriority99 \lsdlocked0 Emphasis;\lsdpriority99 \lsdlocked0 Document Map;\lsdpriority99 \lsdlocked0 Plain Text;\lsdpriority99 \lsdlocked0 E-mail Signature;\lsdpriority99 \lsdlocked0 Normal (Web);\lsdpriority99 \lsdlocked0 HTML Acronym;\lsdpriority99 \lsdlocked0 HTML Address;\lsdpriority99 \lsdlocked0 HTML Cite;\lsdpriority99 \lsdlocked0 HTML Code;\lsdpriority99 \lsdlocked0 HTML Definition;\lsdpriority99 \lsdlocked0 HTML Keyboard;\lsdpriority99 \lsdlocked0 HTML Preformatted;\lsdpriority99 \lsdlocked0 HTML Sample;\lsdpriority99 \lsdlocked0 HTML Typewriter;\lsdpriority99 \lsdlocked0 HTML Variable;\lsdpriority99 \lsdlocked0 Normal Table;\lsdpriority99 \lsdlocked0 annotation subject;\lsdpriority99 \lsdlocked0 No List;\lsdpriority99 \lsdlocked0 1 / a / i;\lsdpriority99 \lsdlocked0 1 / 1.1 / 1.1.1;\lsdpriority99 \lsdlocked0 Article / Section;\lsdpriority99 \lsdlocked0 Table Simple 1;\lsdpriority99 \lsdlocked0 Table Simple 2;\lsdpriority99 \lsdlocked0 Table Simple 3;\lsdpriority99 \lsdlocked0 Table Classic 1;\lsdpriority99 \lsdlocked0 Table Classic 2;\lsdpriority99 \lsdlocked0 Table Classic 3;\lsdpriority99 \lsdlocked0 Table Classic 4;\lsdpriority99 \lsdlocked0 Table Colorful 1;\lsdpriority99 \lsdlocked0 Table Colorful 2;\lsdpriority99 \lsdlocked0 Table Colorful 3;\lsdpriority99 \lsdlocked0 Table Columns 1;\lsdpriority99 \lsdlocked0 Table Columns 2;\lsdpriority99 \lsdlocked0 Table Columns 3;\lsdpriority99 \lsdlocked0 Table Columns 4;\lsdpriority99 \lsdlocked0 Table Columns 5;\lsdpriority99 \lsdlocked0 Table Grid 1;\lsdpriority99 \lsdlocked0 Table Grid 2;\lsdpriority99 \lsdlocked0 Table Grid 3;\lsdpriority99 \lsdlocked0 Table Grid 4;\lsdpriority99 \lsdlocked0 Table Grid 5;\lsdpriority99 \lsdlocked0 Table Grid 6;\lsdpriority99 \lsdlocked0 Table Grid 7;\lsdpriority99 \lsdlocked0 Table Grid 8;\lsdpriority99 \lsdlocked0 Table List 1;\lsdpriority99 \lsdlocked0 Table List 2;\lsdpriority99 \lsdlocked0 Table List 3;\lsdpriority99 \lsdlocked0 Table List 4;\lsdpriority99 \lsdlocked0 Table List 5;\lsdpriority99 \lsdlocked0 Table List 6;\lsdpriority99 \lsdlocked0 Table List 7;\lsdpriority99 \lsdlocked0 Table List 8;\lsdpriority99 \lsdlocked0 Table 3D effects 1;\lsdpriority99 \lsdlocked0 Table 3D effects 2;\lsdpriority99 \lsdlocked0 Table 3D effects 3;\lsdpriority99 \lsdlocked0 Table Contemporary;\lsdpriority99 \lsdlocked0 Table Elegant;\lsdpriority99 \lsdlocked0 Table Professional;\lsdpriority99 \lsdlocked0 Table Subtle 1;\lsdpriority99 \lsdlocked0 Table Subtle 2;\lsdpriority99 \lsdlocked0 Table Web 1;\lsdpriority99 \lsdlocked0 Table Web 2;\lsdpriority99 \lsdlocked0 Table Web 3;\lsdpriority99 \lsdlocked0 Balloon Text;\lsdpriority99 \lsdlocked0 Table Grid;\lsdpriority99 \lsdlocked0 Table Theme;\lsdpriority99 \lsdlocked0 Placeholder Text;\lsdpriority99 \lsdlocked0 No Spacing;\lsdpriority99 \lsdlocked0 Light Shading;\lsdpriority99 \lsdlocked0 Light List;\lsdpriority99 \lsdlocked0 Light Grid;\lsdpriority99 \lsdlocked0 Medium Shading 1;\lsdpriority99 \lsdlocked0 Medium Shading 2;\lsdpriority99 \lsdlocked0 Medium List 1;\lsdpriority99 \lsdlocked0 Medium List 2;\lsdpriority99 \lsdlocked0 Medium Grid 1;\lsdpriority99 \lsdlocked0 Medium Grid 2;\lsdpriority99 \lsdlocked0 Medium Grid 3;\lsdpriority99 \lsdlocked0 Dark List;\lsdpriority99 \lsdlocked0 Colorful Shading;\lsdpriority99 \lsdlocked0 Colorful List;\lsdpriority99 \lsdlocked0 Colorful Grid;\lsdpriority99 \lsdlocked0 Light Shading Accent 1;\lsdpriority99 \lsdlocked0 Light List Accent 1;\lsdpriority99 \lsdlocked0 Light Grid Accent 1;\lsdpriority99 \lsdlocked0 Medium Shading 1 Accent 1;\lsdpriority99 \lsdlocked0 Medium Shading 2 Accent 1;\lsdpriority99 \lsdlocked0 Medium List 1 Accent 1;\lsdpriority99 \lsdlocked0 List Paragraph;\lsdpriority99 \lsdlocked0 Quote;\lsdpriority99 \lsdlocked0 Intense Quote;\lsdpriority99 \lsdlocked0 Medium List 2 Accent 1;\lsdpriority99 \lsdlocked0 Medium Grid 1 Accent 1;\lsdpriority99 \lsdlocked0 Medium Grid 2 Accent 1;\lsdpriority99 \lsdlocked0 Medium Grid 3 Accent 1;\lsdpriority99 \lsdlocked0 Dark List Accent 1;\lsdpriority99 \lsdlocked0 Colorful Shading Accent 1;\lsdpriority99 \lsdlocked0 Colorful List Accent 1;\lsdpriority99 \lsdlocked0 Colorful Grid Accent 1;\lsdpriority99 \lsdlocked0 Light Shading Accent 2;\lsdpriority99 \lsdlocked0 Light List Accent 2;\lsdpriority99 \lsdlocked0 Light Grid Accent 2;\lsdpriority99 \lsdlocked0 Medium Shading 1 Accent 2;\lsdpriority99 \lsdlocked0 Medium Shading 2 Accent 2;\lsdpriority99 \lsdlocked0 Medium List 1 Accent 2;\lsdpriority99 \lsdlocked0 Medium List 2 Accent 2;\lsdpriority99 \lsdlocked0 Medium Grid 1 Accent 2;\lsdpriority99 \lsdlocked0 Medium Grid 2 Accent 2;\lsdpriority99 \lsdlocked0 Medium Grid 3 Accent 2;\lsdpriority99 \lsdlocked0 Dark List Accent 2;\lsdpriority99 \lsdlocked0 Colorful Shading Accent 2;\lsdpriority99 \lsdlocked0 Colorful List Accent 2;\lsdpriority99 \lsdlocked0 Colorful Grid Accent 2;\lsdpriority99 \lsdlocked0 Light Shading Accent 3;\lsdpriority99 \lsdlocked0 Light List Accent 3;\lsdpriority99 \lsdlocked0 Light Grid Accent 3;\lsdpriority99 \lsdlocked0 Medium Shading 1 Accent 3;\lsdpriority99 \lsdlocked0 Medium Shading 2 Accent 3;\lsdpriority99 \lsdlocked0 Medium List 1 Accent 3;\lsdpriority99 \lsdlocked0 Medium List 2 Accent 3;\lsdpriority99 \lsdlocked0 Medium Grid 1 Accent 3;\lsdpriority99 \lsdlocked0 Medium Grid 2 Accent 3;\lsdpriority99 \lsdlocked0 Medium Grid 3 Accent 3;\lsdpriority99 \lsdlocked0 Dark List Accent 3;\lsdpriority99 \lsdlocked0 Colorful Shading Accent 3;\lsdpriority99 \lsdlocked0 Colorful List Accent 3;\lsdpriority99 \lsdlocked0 Colorful Grid Accent 3;\lsdpriority99 \lsdlocked0 Light Shading Accent 4;\lsdpriority99 \lsdlocked0 Light List Accent 4;\lsdpriority99 \lsdlocked0 Light Grid Accent 4;\lsdpriority99 \lsdlocked0 Medium Shading 1 Accent 4;\lsdpriority99 \lsdlocked0 Medium Shading 2 Accent 4;\lsdpriority99 \lsdlocked0 Medium List 1 Accent 4;\lsdpriority99 \lsdlocked0 Medium List 2 Accent 4;\lsdpriority99 \lsdlocked0 Medium Grid 1 Accent 4;\lsdpriority99 \lsdlocked0 Medium Grid 2 Accent 4;\lsdpriority99 \lsdlocked0 Medium Grid 3 Accent 4;\lsdpriority99 \lsdlocked0 Dark List Accent 4;\lsdpriority99 \lsdlocked0 Colorful Shading Accent 4;\lsdpriority99 \lsdlocked0 Colorful List Accent 4;\lsdpriority99 \lsdlocked0 Colorful Grid Accent 4;\lsdpriority99 \lsdlocked0 Light Shading Accent 5;\lsdpriority99 \lsdlocked0 Light List Accent 5;\lsdpriority99 \lsdlocked0 Light Grid Accent 5;\lsdpriority99 \lsdlocked0 Medium Shading 1 Accent 5;\lsdpriority99 \lsdlocked0 Medium Shading 2 Accent 5;\lsdpriority99 \lsdlocked0 Medium List 1 Accent 5;\lsdpriority99 \lsdlocked0 Medium List 2 Accent 5;\lsdpriority99 \lsdlocked0 Medium Grid 1 Accent 5;\lsdpriority99 \lsdlocked0 Medium Grid 2 Accent 5;\lsdpriority99 \lsdlocked0 Medium Grid 3 Accent 5;\lsdpriority99 \lsdlocked0 Dark List Accent 5;\lsdpriority99 \lsdlocked0 Colorful Shading Accent 5;\lsdpriority99 \lsdlocked0 Colorful List Accent 5;\lsdpriority99 \lsdlocked0 Colorful Grid Accent 5;\lsdpriority99 \lsdlocked0 Light Shading Accent 6;\lsdpriority99 \lsdlocked0 Light List Accent 6;\lsdpriority99 \lsdlocked0 Light Grid Accent 6;\lsdpriority99 \lsdlocked0 Medium Shading 1 Accent 6;\lsdpriority99 \lsdlocked0 Medium Shading 2 Accent 6;\lsdpriority99 \lsdlocked0 Medium List 1 Accent 6;\lsdpriority99 \lsdlocked0 Medium List 2 Accent 6;\lsdpriority99 \lsdlocked0 Medium Grid 1 Accent 6;\lsdpriority99 \lsdlocked0 Medium Grid 2 Accent 6;\lsdpriority99 \lsdlocked0 Medium Grid 3 Accent 6;\lsdpriority99 \lsdlocked0 Dark List Accent 6;\lsdpriority99 \lsdlocked0 Colorful Shading Accent 6;\lsdpriority99 \lsdlocked0 Colorful List Accent 6;\lsdpriority99 \lsdlocked0 Colorful Grid Accent 6;}}{\*\generator WPS Office}{\info {\version1 }{\nofpages1 }}\paperw12240 \paperh15840 \margl1800 \margr1800 \margt1440 \margb1440 \gutter0 \deftab420 \ftnbj \aenddoc \dghspace180 \dgvspace180 \dghorigin0 \dgvorigin0 \dghshow0 \dgvshow0 \jcompress1 \viewkind0 \viewscale0 \viewscale0 \splytwnine \ftnlytwnine \htmautsp \useltbaln \alntblind \lytcalctblwd \lyttblrtgr \lnbrkrule \nogrowautofit \viewkind0 \nobrkwrptbl \wrppunct \felnbrelev \spltpgpar \notvatxbx {\*\fchars }{\*\lchars }\fet2 {\*\ftnsep \pard \plain {\insrsid \chftnsep \par }}{\*\ftnsepc \pard \plain {\insrsid \chftnsepc \par }}{\*\aftnsep \pard \plain {\insrsid \chftnsep \par }}{\*\aftnsepc \pard \plain {\insrsid \chftnsepc \par }}\sectd \sbkpage \pgwsxn11906 \pghsxn16838 \marglsxn1800 \margrsxn1800 \margtsxn1440 \margbsxn1440 \guttersxn0 \headery851 \footery992 \pgbrdropt32 \sectlinegrid312 \sectspecifyl \endnhere \pard \plain \qj \li0 \ri0 \nowidctlpar \aspalpha \aspnum \adjustright \lin0 \rin0 \itap0 \rtlch \fcs1 \af0 \afs22 \ltrch \fcs0 \fs21 \kerning2 \rtlch \alang1025 \ltrch \dbch \af2 \hich \af2 \loch \af2 \lang1033 \langnp1033 \langfe2052 \langfenp2052 \alang1025 {\rtlch \fcs1 \af0 \afs22 \ltrch \fcs0 \fs21 \kerning2 \rtlch \alang1025 \ltrch \loch \af2 \hich \af2 \dbch \f2 \lang1033 \langnp1033 \langfe2052 \langfenp2052 \alang1025 \'b7\'bf\'bc\'db\'bb\'d8\'b9\'e9\'bd\'e1\'b9\'fb\'bd\'c5\'ba\'f3\'b8\'fa\'bf\'cd\'bc\'d2\'bb\'b0\'bf\'b4\'bf\'b4\'bb\'b7\'be\'b3}{\rtlch \fcs1 \af0 \afs22 \ltrch \fcs0 \fs21 \kerning2 \rtlch \alang1025 \ltrch \dbch \af2 \hich \af2 \loch \f2 \lang1033 \langnp1033 \langfe2052 \langfenp2052 \alang1025 \par }}
0
Huan jia
Top achievements
Rank 1
Iron
answered on 24 Jul 2021, 11:07 AM
Tanya, my attachment shows how do i obtain the correct content.
0
Tanya
Telerik team
answered on 27 Jul 2021, 03:11 PM

Hello Huan jia,

Thank you for your cooperation on that.

I have tested the provided RTF and confirmed that the issue is the same as the one I linked previously - the characters are not parsed because of a not-supported definition. For convenience, I am pasting the link to the feedback item for that functionality again: RichTextBox: Support import from RTF of multi-byte Unicode characters represented with multiple ANSI characters in the form \'xx. The RTF contains the  \fcharset134 control word, indicating that the characters are double-byte. What I can suggest in this case is to use the HtmlFormatProvider to import the pasted content. It will allow you to properly preserve the characters.

Hope this information is useful.

Regards,
Tanya
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
RichTextBox
Asked by
Huan jia
Top achievements
Rank 1
Iron
Answers by
Huan jia
Top achievements
Rank 1
Iron
Tanya
Telerik team
Share this question
or