Solved

How do I encode currencies with XHTML and HTMLTIdy?

Posted on 2011-09-26
4
243 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 500 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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Compute age Html 2 27
ASP Classic - Read XML File inner content 10 49
How to get chosen background-color on every line? 10 21
output in HTML format powershell 6 24
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

730 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