473,408 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

AxWebBrowser wrongly displays special characters

Hi there,

I am new to this board and would first of all like to wish you all
Happy Hollidays.
As most new users, I joined because I have an issue (problem).

I am using VB.NET in a windows app and have a rich text box on a form
containing text with HTML syntax elements, like
"<b>Hello</b>"

If I click on the button on this form, I write the text box contents
to the text file (saved with html extension) and invoke a form with
an AxWebBrowser control that navigates to that text file.

The browser control displays my formatted text just as I would expect,
with one exception:
Special characters, like the symbol ®, are displayed with another
character as a prefix, like this: ®

I thought it might have to do with the font that I am using (default
MS Sans Serif), but the AxWebBrowser control does not even have a
font property.

Does anyone understand what I am trying to explain? And if so, does
anyone know what my problem is and how I can solve it?

Any help would be greatly appreciated...

IS :D

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 20 '05 #1
5 1752
* in********@aol-dot-com.no-spam.invalid (ISdotNET) scripsit:
I am new to this board and would first of all like to wish you all
Happy Hollidays.
As most new users, I joined because I have an issue (problem).

I am using VB.NET in a windows app and have a rich text box on a form
containing text with HTML syntax elements, like
"<b>Hello</b>"

If I click on the button on this form, I write the text box contents
to the text file (saved with html extension) and invoke a form with
an AxWebBrowser control that navigates to that text file.

The browser control displays my formatted text just as I would expect,
with one exception:
Special characters, like the symbol ®, are displayed with another
character as a prefix, like this: ®


You will have to include a charset definition in your file. Without
knowing what exactly you write into the file and if it is valid HTML or
XHTML, it's hard to say anything.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
Herfried

First of all, thank you for your response. I am pretty sure that the
included HTML elements are all pure HTML.
As a matter of fact, even if I don't include any HTML elements but
only the character described in my initial question above (in the
middle of the regular text), the display is still wrong.

Sample:

A file named text.html contains the following text

Hello® World

The control displays it like

Hello® World
If I select "View Source" I see the appropriate text in the source
file of the web-control.

You might be right, it could be that I would need to expand the
charset, but I have no idea on how to do that, my web experience is
still limited.

Could you, or anybody else, guide me in the right direction?

Thanks upfront, Happy New Year,

IS :D

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 20 '05 #3
Cor
Hi ISdotNet,

Did you try what IE is showing when you use that text?

Cor
First of all, thank you for your response. I am pretty sure that the
included HTML elements are all pure HTML.
As a matter of fact, even if I don't include any HTML elements but
only the character described in my initial question above (in the
middle of the regular text), the display is still wrong.

Nov 20 '05 #4
* in********@aol-dot-com.no-spam.invalid (ISdotNET) scripsit:
First of all, thank you for your response. I am pretty sure that the
included HTML elements are all pure HTML.
As a matter of fact, even if I don't include any HTML elements but
only the character described in my initial question above (in the
middle of the regular text), the display is still wrong.

Sample:

A file named text.html contains the following text

Hello® World

The control displays it like

Hello® World


Does the file show properly if you open it in Internet Explorer?

Are you sure the encoding used to write the file and the encoding
specified in the file are matching?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
Herfried and Cor,

Thank you so much, you guided me in the correct direction.

The actual problem is not the Web control, it is the way I was writing
the data to the html file.

As you suggested, I tried to run the file directly in IE and got the
same bad result. Next, I simply opened the file in Notepad and hit
Save, and guess what, the results in IE were correct.

Here is the analysis of the problem and it's fix.

I wrote to the file by simply saying:

Dim path As String = Application.StartupPath
Dim writer As StreamWriter = New StreamWriter(path &
"/test.html")

Then I read that the StreamWriter saves a file by default with
UTF8Encoding. So I changed the above lines to read as follows:

[i:267cf0d8de]Dim path As String = Application.StartupPath
Dim writer As StreamWriter = New StreamWriter(path & "/test.html",
False, System.Text.Encoding.Unicode)[/i:267cf0d8de]

And that did it ...

Thanks again, maybe one of these days I might be able to help you.

IS :D

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Roy W. Andersen | last post by:
I've been searching google about this for days but can't find anything, so I'm hoping someone here can help me out. I'm trying to create zip-files without needing the zip-file extension in PHP,...
3
by: Barry Olly | last post by:
Hi, I'm working on a mini content management system and need help with dealing with special characters. The input are taken from html form which are then stored into a varchar column in...
0
by: Matthias Kwiedor | last post by:
I have a aplication which hosts an axWebbrowser. This activex component needs about 10 to 15 mb of memory. Because i have a option to move the aplication to tray icon and do some timer work i...
10
by: Richard Steele | last post by:
Can anyone help me I am developing an application runs on a PC (client) only. For graphical reasons it was decided that the content would be displayed in a Browser that is embedded in a Windows...
1
by: Les Caudle | last post by:
I created an app that uses an axWebBrowser control to display a local xml file and had no problems. When the form is initially loaded, it displays an htm file that says no file is loaded: ...
5
by: Sakharam Phapale | last post by:
Hi All, I am using an API function, which takes file path as an input. When file path contains special characters (@,#,$,%,&,^, etc), API function gives an error as "Unable to open input file"....
2
by: hplloyd | last post by:
Hi, My question is very simple I am sure but I cant seem to find a solution anywhere.... I have a windows form in C# and I have added an axWebBrowser control. When the form loads I am trying...
1
by: sonald | last post by:
Dear All, I am working on a module that validates the provided CSV data in a text format, which must be in a predefined format. We check for the : 1. Number of fields provided in the text file,...
3
KevinADC
by: KevinADC | last post by:
Purpose The purpose of this article is to discuss the difference between characters inside a character class and outside a character class and some special characters inside a character class....
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.