We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Copying RTF from RichEditBox to SfRichTextBoxAdv

Thread ID:

Created:

Updated:

Platform:

Replies:

120038 Aug 25,2015 06:49 PM Aug 27,2015 05:04 AM WinRT 4
loading
Tags: SfRichTextBoxAdv
Nima Tayebi
Asked On August 25, 2015 06:49 PM

I'm getting this exception while loading the stream into SfRichTextBoxAdv

{"'Windows-1252' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.\r\nParameter name: name"}

Code:

                var iStream = new InMemoryRandomAccessStream();
                this.ContentTextBox.Document.SaveToStream(Windows.UI.Text.TextGetOptions.FormatRtf, iStream);
                iStream.Seek(0);
                this.RichTextBoxAdv.Load(iStream.AsStream(), Syncfusion.UI.Xaml.RichTextBoxAdv.FormatType.Docx);

Any idea how I can fix this?

Nima Tayebi
Replied On August 26, 2015 04:00 AM

It took me a while but I found the solution.
Windows-1252 is downloadable with a NuGet package: System.Text.Encoding.CodePages

Then I needed to add this line to my code

                Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);

Narendran Srinivasan [Syncfusion]
Replied On August 26, 2015 07:44 AM

Hi Nima

Thanks for choosing Syncfusion products,


The mentioned exception is raised due to not installing the ‘System.Text.Encoding.CodePages’ so when we accessing the GetEncoding method this exception raised. Once the nugget ‘System.Text.Encoding.CodePages’ has installed this exception has been resolved. But in our machine we could not able to reproduce the mentioned exception while loading RichEditBox document stream in our SfRichTextBoxAdv control. In our side the given code snippet is working fine in our supported platforms. We request you to provide the details about Visual Studio, Operating system versions and in which platform and framework you are getting this issue. If possible please provide us a sample so that we can validate more on this and provide you with appropriate solution at the earliest.

Please let us know if you have any other questions.

Regards,
Narendran



Nima Tayebi
Replied On August 26, 2015 01:22 PM

Hi Narendran, 
I'm using WinRT libraries on Windows 10 UWP that is not officially supported by your the libraries. 
Please let me know if you need more information.
Thanks, 
Nima

Arumuga Perumal S [Syncfusion]
Replied On August 27, 2015 05:04 AM

Hi Nima,

Thank you for your update.

We have already provided support for SfRichTextBoxAdv control in Universal Windows platform and is included with our Essential Studio for UWP. You can download it from the following link.

http://www.syncfusion.com/downloads/uwp

You can use our UWP assemblies for building Universal Windows applications.

Please let us know if you have any other questions.

Regards,
Arumuga Perumal S.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;