Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do I encode currencies with XHTML and HTMLTIdy?

Posted on 2011-09-26
4
Medium Priority
?
247 Views
Last Modified: 2012-05-12
Hi,

I am trying to sanitize HTML to XHTML using HTMLTidy.

I have "£" signs in my input HTML. However these seem to be getting corrupted. In GUI Tidy I not that the "£"s are coming as "A£" in the original HTML so no wonder there is corruption.

I am actually doing this conversion in a web app and I can specify the Input and Output encoding. However whatever I try I still get corruption.

Ideas please? This is driving me mad!!!

I could change the "£"s to "£" or "£" in the input HTML if that helps.

Thanks for any help.

Sam
0
Comment
Question by:SamJolly
  • 3
4 Comments
 

Author Comment

by:SamJolly
ID: 36602247
I have tried using "£" and defining the input and out character encoding as UTF-16. However I get little vertical rectangles.....

Sam
0
 
LVL 15

Accepted Solution

by:
Jagadishwor Dulal earned 2000 total points
ID: 36672948
Try changing UTF-8 and use  £ or £ there should not be problem
0
 

Author Comment

by:SamJolly
ID: 36708316
Hi,

Thanks for the comment. Yes, I have changed to UTF-8 and use £. After research I found that .NET was corrupting theses entities and so I have changed my coding to use Bytes as opposed to straight strings and it now works.

Thanks,

Sam
0
 

Author Closing Comment

by:SamJolly
ID: 36708317
thks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will learn how to count occurrences of each item in an array.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question