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 =--- 5 1767
* 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>
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 =---
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.
* 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>
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.Sta rtupPath
Dim writer As StreamWriter = New StreamWriter(pa th &
"/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.Sta rtupPath
Dim writer As StreamWriter = New StreamWriter(pa th & "/test.html",
False, System.Text.Enc oding.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 =--- This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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, mainly because I need the ability to both create and extract
zip-files. I've tried a couple of classes found here and there, and they
all seem to have the same problem. I'm currently using PclZip
(http://phpconcept.net/pclzip/) but even the...
|
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 oracle database.
When i retrieve the data, some of the special characters have been
changed to ??? and also
|
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 don't want that it just spends over 10mb for nothing.
So i remove the axwebbrowser with
axwebbrowser1.dispose()
which works fine. After show the application back from the tray icon i will
implement the axwebbrowser again with the same i did it...
|
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 Forms application (VS net 2003) c#
I have a Windows Form that uses a webbrowser (AxWebBrowser) )to display
html derived from internal classes that builds data from a database. The
HTML displays correctly. The HTML is built at runtime and the...
|
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:
object o = System.Reflection.Missing.Value;
axWebBrowser1.Navigate(@"file:///" + ((string)(Application.StartupPath +
@"\noXml.htm")).Replace(@"\",@"/"), ref o, ref o, ref o, ref o);
| |
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".
Same file path containing special characters works fine in one machine, but
doesn't work in other.
I am using following API function to get short file path.
Declare Auto Function GetShortPathName Lib "kernel32" (ByVal lpszLongPath As
|
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 to display a web page in the control.... but I
have tried Navigate and Navigate2 methods and whatever I try nothing is
displayed... The code that I am using in the forms load event is
|
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,
2. Text checks for max. length of the field & whether the field is
mandatory or optional
Example:
|
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. This is not a regular expression tutorial. Assumes you are already familiar with basic regular expression concepts and terminology. If not, you may want to read some regular expression tutorial. See the end of the article for links to online resources....
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |