|
-
Mar 8th, 2006, 11:06 AM
#1
Thread Starter
Fanatic Member
Unicode or what?
Hello, I've got this problem when I came across saving a text file pasted from a site to a RichTextBox. Example of this character that could cause a problem would be
“The senators are is...
Note the double quote. It's not an ordinary quote I guess because when saved as
Code:
s = string.Format("<html><head><link rel='stylesheet' href='style.css'></head><body><blockquote>{0}</blockquote></body></html>", s);
byte[] content = UnicodeEncoding.Unicode.GetBytes(s);
FileStream w = new FileStream(Application.StartupPath + "\\test.html", FileMode.Create);
w.Write(content, 0, content.Length);
s is an RTB.Text. Now when Process.Start("iexplore", "test.html"); the double quote colored red is displayed as a little square. I guess it's implying it's not noticeable.
Any help? Thanks in advance.
Last edited by nebulom; Mar 8th, 2006 at 11:09 AM.
-
Mar 8th, 2006, 11:27 AM
#2
Re: Unicode or what?
have you tried setting charset in Internet Exploder (View -> Encoding) ? Might be that you method is not correctly setting the BOM (byte order mark) or something obscure.
-
Mar 9th, 2006, 12:48 AM
#3
Thread Starter
Fanatic Member
Re: Unicode or what?
The thing pen is, it displays when I saved it to database and retreive it. My app should have a preview functionality. Say, I copy paste an article from the net to my RTB. Example would be the
“That’s queer.
having a not ordinary quote. The problem happens when I saved it to a .html and view it on iexplore. The problem doesn't seem to occur when that text (even with the [I don't know] quote) is saved on the database and retreive on a webpage.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|