Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / June 2007

Tip: Looking for answers? Try searching our database.

a - makes â?" - encoding characters?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Lozzi - 07 Jun 2007 17:38 GMT
Howdy,

I have a simple CMS tool on a site, and the app edits the page directly and
puts in the new HTML from the editor. The problem i have is that they are
pasting items from MS Word, and Word likes to take two dashs and smush them
into a single long dash - chr(151). When I open the file to save the text, i
do the following, and it appears that the encoding is throwing an issue and
convers the - to â?". How do I keep the correct encoding?

       Dim fs As FileStream
       fs = File.Open(path, FileMode.Create)
       Dim text() As Byte = New UTF8Encoding(True).GetBytes(BuildNewPage)

       fs.Write(text, 0, text.Length)
       fs.Close()
       fs.Dispose()

When i hit send it didnt like the characters in this message so you may not
be seeing exactly what i'm seeing... sorry. but i hope you understand the
issue.

Thanks!!

David Lozzi
David Lozzi - 07 Jun 2007 17:41 GMT
In the true output, the ? is a wacked out E...

> Howdy,
>
[quoted text clipped - 20 lines]
>
> David Lozzi
David Lozzi - 07 Jun 2007 17:51 GMT
Found it. Changed to

       Dim text() As Byte = Encoding.Default.GetBytes(BuildNewPage)

Thanks!

> In the true output, the ? is a wacked out E...
>
[quoted text clipped - 23 lines]
>>
>> David Lozzi

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.