Welcome Guest Search | Active Topics | Sign In | Register

WebBrowser for WPF - NewWindow and Character enconding Options
Pablo.R
Posted: Thursday, July 7, 2016 11:30:26 AM
Rank: Newbie
Groups: Member

Joined: 7/20/2015
Posts: 2
Hello, I'm having problems with character encoding when loading pages in a popup window, for that matter I handle the NewWindow event and instantiate a new Window which contains a WebBrowser to which I set the WebView.

Now the problems is that loading a page which contains latin characters, (á, é, í, ó, ú, ñ), doesn't work correctly, even though the html contains this meta tag:

Code: HTML/ASPX
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">


I do see it correctly when using a regular browser... and I'm not sure what else can I try... this is the code I use for the popup

Code: C#
// NewWindow event handler
         void WebView_NewWindow(object sender, NewWindowEventArgs e)
        {
            PopupWindow p = new PopupWindow(e);
            e.Accepted = true;
            p.Show();

            this._popups.Add(p);
        }

//-----------------------------------------------------------------------------

        //Popup window ctor
        public PopupWindow(EO.WebBrowser.NewWindowEventArgs e)
        {
            InitializeComponent();

            this.Browser.WebView = e.WebView;
            this.Browser.WebView.SetOptions(new EO.WebBrowser.BrowserOptions()
            {
                AllowJavaScript = true,
                DefaultEncoding = System.Text.Encoding.UTF8
            });
        }


Thanks in advance!
eo_support
Posted: Thursday, July 7, 2016 11:48:12 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,275
Hi,

Your code looks fine. Can you try to isolate the problem into a test project and send it to us so that we can investigate further? See here for more information on how to send test project:

http://www.essentialobjects.com/forum/test_project.aspx

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.