html-entities

C Sharp serialise XML with HTML entities

I have a string in the database which contains angle brackets (less-than/greater-than). I need to insert the string into an XElement and then serialise it to a client device. Now the html entities obviously get encoded so the brackets appear as < and > and the best way may be is to use the HttpUtility.HtmlDecode to decode the entities ba...

Find/Replace htmlentities using the standard linux toolchain?

Is there a way I can do something like the following using the standard linux toolchain? Let's say the source at example.com/index.php is: Hello, &amp; world! &quot; How can I do something like this... curl -s http://example.com/index.php | htmlentities ...that would print the following: Hello, & world! " Using only the standar...

google charts url works in img tag but not in browser location bar

Hi, I'm using django-googlecharts to generate a simple pie chart. Inside the img tag, it works just fine, but if I paste the img src in the location bar of the browser, google returns "Bad Request", "Your client has issued a malformed or illegal request". I followed the example in the django-googlecharts documentation here: http://gith...

Is It Possible to Comment Out HTML Code in a Wordpress Post?

Sometimes I need to inject some raw HTML code into a Wordpress post, and sometimes I need to comment out a chunk of that code.! With a plain text editor, I can just use <!-- Comment --> around the chunk I want to hide. But when I try this in a WP post, it does hide the code but I still see the "closing comment tag" -->. What's the r...

How to automatically replace all special characters with HTML equivalents?

I have an html document that contains hundreds of special chracters (such as em dashes, smart apostrophes, accent egrave, etc) that I would like to convert to their html equivalents. For example, my document contains an "em dash" (—), which I would like to convert to: &#8212; Of course, my html document contains html tags. I do not...

need to selectively escape html entities (&)

I'm scraping a html page, then using xml.dom.minidom.parseString() to create a dom object. however, the html page has a '&'. I can use cgi.escape to convert this into &amp; but it also converts all my html <> tags into &lt;&gt; which makes parseString() unhappy. how do i go about this? i would rather not just hack it and straight rep...

jQuery: ajax POST with html entities

Helloes. I've been sending forms with jQuery ajax & $(this).serialize to php & database and it has worked perfectly. Now I have situation where I can't use serialized form but generate a string from different input fields instead and the problem is that it appears to lose some URL entities in the process. for example "&phone=+3581234567...

jQuery change() not triggering when pressing space?

In order to highlight spacing between Chinese characters I've got this code function replaceSpaces(){ var segmented = $(this).val().replace(/\s/g, "<span>&emsp;</span>"); $('#preview').html(segmented); } $(document).ready(function(){ $('.tobesegmented').focus(replaceSpaces); $('.tobesegmented').change(replaceSpaces); });...

Displaying feed with the correct html character entities

I have feed that's already broken down into the content I need. Part of that content contains things such as &\; and "\;. I'm using PHP's str_replace() to find and replace them to be their correct html character entities (ex. &amp;). However, it won't find this: $find = array('&\;', '"\;', '\;'); And I would replace them like this:...

Encoding issue, coverting &amp; to & for html using php

I have a url in html: <a href="index.php?q=event&amp;id=56&amp;date=128"> I need to turn it into a string exactly as: <a href="index.php?q=event&id=56&date=128"> I know how to do this with preg_replace etc, but is there a function in php that deals directly with encoding that I can use for other encoding issues such as &nsbp (or wh...

Ignoring HTML entity for ampersand in MySQL Full-Text Search

I have a lot of data that is being entered into records with the HTML entity &amp;. A full-text search for the word "amp" will result in records containing &amp; to be shown, which is highly undesirable. Presumably this is because MySQL ignores the '&' and the ';'. So does anyone know of any way within MySQL to force it to treat special...

HTML character entities and character encoding set

When including HTML entities in an HTML document, do the entities need to be from the same character encoding set that the document is specified to be using? For example, if I am going to use the copyright sign in an HTML document that is specified as UTF-8, is it necessary to use the Unicode HTML entity (&#x00A9;) or is it okay to use ...

How to convert HTML character NUMBERS to plain characters in PHP?

I have some HTML data (over which I have no control, can only read it) that contains a lot of Scandinavian characters (å, ä, ö, æ, ø, etc.). These "special" chars are stored as HTML character numbers (æ = &#230;). I need to convert these to the corresponding actual character in PHP (or JavaScript but I guess PHP is better here...). Seems...

How to display XML source code using HTML with Emacs?

In the HTML file, I need to show some XML code. The problem is that I can't use <pre>..</pre> to show '<' and '>'. What would be the solution for this problem? ADDED From the answer, replacing '<' and '>' to &lt; and&gt; can be a solution. I'm an Emacs user, are there Emacs tools/magic to do that automatically? I mean, I can us...

Force display text from Unicode in input field (from ajax)

Hello all, We are doing an ajax call to retrieve from database. Since our clients may use different languages we encode everything into unicode to store in the database (saves worrying about collations and such). Now when we fetch such content to be displayed in an input text field it is displaying the unicode codes. Checked the HTML 4 ...

encoding/decoding translated sentence

I've the following script in my HTML: jQuery.sundayMorning(text, { destination: 'en' }, function(response) { var uri = response.translation; var text = decodeURIComponent(uri); jQuery(".showText").val(text); }); Example input in Spanish: la casa de leo el combatiente. This translates into English as: leo&#39;s house fight...

NSXMLParser Encoding Question

I have a .NET web service that is returning the following: <ArrayOfAddressLocation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/"&gt; <AddressLocation> <AddressLocationId>0</AddressLocationId> <SubscribedCount>0</SubscribedCount> <City>Flor...

NSXMLParser Entity Problem

I have a .NET web service that is returning the following: <ArrayOfAddressLocation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/"&gt; <AddressLocation> <AddressLocationId>0</AddressLocationId> <SubscribedCount>0</SubscribedCount> <City>Flor...

Transmitting newline character "\n"

Given the following URL (working, try it!) https://select-test.wp3.rbsworldpay.com/wcc/purchase?instId=151711&amp;cartId=28524&amp;currency=GBP&amp;amount=1401.49&amp;testMode=100&amp;name=Tom%20Gul&amp;address=24%20House%20Road\nSome Place\nCounty&postcode=TR33%20999&[email protected]&country=GB If you click on the link and g...

Why are Html Entities replaced by MS Expression Web??

I'm using Microsofts Expression Web 5 to edit my HTML documents. I have noticed a strange behaviour when using the 'Reformat HTML' method. If my html document (UTF-8) contains html entities in the like of the entity is replaced by a euro character. The html entities with a special meaning like '<' and '>' will not be replaced. So '<' (...