For quite some time I’m using a tool a co-worker has written to convert some text into “websafe” text. That’s implying the convertion of special characters into html entities wherever possible, otherwise in their corresponding unicode notation (�), replacing more then one space in a row with non-breaking spaces ( ), replacing single line-breaks with the corresponding html-tag (<br />) and also enclosing paragraphs with their html-tag (<p>…</p>). Texts converted in this manner are having less or even no encoding problems in any webbrowsers and you don’t have to fiddle around with manual adding those paragraph tags.
I’m using this tool a lot when working with html files directly in Notepad++ or a similar texteditor. But since that time I’m now mainly working within Visual Studio. You may argue that you can add the text in the design-view and Visual Studio is converting it for you. But not all special chars are converted and when the text is some kind of rich edit (e.g. from Word) you get a lot of unwanted formatting, too! So you could paste it into a plain-text editor, copy it back to the clipboardf and then paste it into Vis…. For God’s sake! Let’s abadon this thought immediately before someone will really do it this way! Saying it with a borrowed term: There’s an app for that! 
First you have to make a tough decission: Go straight to the Visual Studio Gallery, download, install and just use my “Unicode Converter”-Extension. Or you read on and I will explain a few things about how I solved some problems. Oh, and just in case: there is a link to the sourcecode of the extension at the end of this article! Mehr...