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...
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, & world! "
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...
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...
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...
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:
—
Of course, my html document contains html tags. I do not...
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 & but it also converts all my html <> tags into <> which makes parseString() unhappy.
how do i go about this? i would rather not just hack it and straight rep...
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...
In order to highlight spacing between Chinese characters I've got this code
function replaceSpaces(){
var segmented = $(this).val().replace(/\s/g, "<span> </span>");
$('#preview').html(segmented);
}
$(document).ready(function(){
$('.tobesegmented').focus(replaceSpaces);
$('.tobesegmented').change(replaceSpaces);
});...
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. &). However, it won't find this:
$find = array('&\;', '"\;', '\;');
And I would replace them like this:...
I have a url in html:
<a href="index.php?q=event&id=56&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...
I have a lot of data that is being entered into records with the HTML entity &. A full-text search for the word "amp" will result in records containing & 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...
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 (©) or is it okay to use ...
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 (æ = æ). I need to convert these to the corresponding actual character in PHP (or JavaScript but I guess PHP is better here...). Seems...
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 < and> can be a solution. I'm an Emacs user, are there Emacs tools/magic to do that automatically? I mean, I can us...
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 ...
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's house fight...
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/">
<AddressLocation>
<AddressLocationId>0</AddressLocationId>
<SubscribedCount>0</SubscribedCount>
<City>Flor...
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/">
<AddressLocation>
<AddressLocationId>0</AddressLocationId>
<SubscribedCount>0</SubscribedCount>
<City>Flor...
Given the following URL (working, try it!)
https://select-test.wp3.rbsworldpay.com/wcc/purchase?instId=151711&cartId=28524&currency=GBP&amount=1401.49&testMode=100&name=Tom%20Gul&address=24%20House%20Road\nSome
Place\nCounty&postcode=TR33%20999&[email protected]&country=GB
If you click on the link and g...
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 '<' (...