htmlentities

Adding HTML entities using CSS content

How do you use the CSS content property to add html entities? I have a number of links which I make into a breadcrumb style list by adding an arrow before each. <div class="breadcrumbs"> <a>One</a> <a>Two</a> <a>Three</a> </div> Which has the following style applied to it: .breadcrumbs a:before { content: '> '; } T...

Symfony 1.4: Is it possible to prevent escaping of a redirect URL?

Hi, If I do a redirect in action as normal: $this->redirect('@mypage?apple=1&banana=2&orange=3'); ... Symfony produces the correct URL: /something/something?apple=1&banana=2&orange=3 However, the following gets escaped for some bizarre reason: $string = 'apple=1&banana=2&orange=3'; $this->redirect('@mypage?'.$string); ... and t...

Using php to create a password system with chinese characters

Hi guys, I'm having an issue with validating chinese characters against other chinese characters, for example I'm creating a simple password script which gets data from a database, and gets the user input through get. The issue I'm having is for some reason, even though the characters look exactly the same when you echo them out, my if...

How to get HTML5 canvas text to show html entity?

I'm parsing an xml file that stores image/caption data both of which I need to display on my canvas. However occasionally there's an entity in the file and when drawing the text to the canvas it interprets it as flat text. How can i get &copy; to show up as on the canvas? Is this even possible, or does anyone know of a good work arou...

UTF8 charset, diacritical elements, conversion problems - and Zend Framework form escaping

Hey, I am writing a webapp in ZF and am having serious issues with UTF8. It's using multi lingual content through Zend Form and it seems that ZF heavily escapes all of these characters and basically just won't show a field if there's diacritical elements 'é' and if I use the HTML entity equivalent e.g. it gets escaped so that the user...

How to decode numeric HTML entities in PHP

Hello, I'm trying to decode encoded long dash from numeric entity to string, but it seems that I can't find a function which can do this properly. The best that I found is mb_decode_numericentity(), however, for some reason it fails to decode long dash and some other special characters. $str = '&#8211;'; $str = mb_decode_numericentit...

Ruby HTML scraper written in Hpricot having trouble with escaped HTML

I am trying to scrape this page: http://www.udel.edu/dining/menus/russell.html. I have written a scraper in Ruby using the Hpricot library. problem: HTML page is escaped and I need to display it unescaped example: "M&amp;M" should be "M&M" example: "Entr&eacute;e" should be "Vegetarian Entrée" I have tried using the CGI library...

In php, Prepare string and create XML/RSS Feed

I want to create my own RSS/XML feed. I fetch data from the database to display, but keep getting invalid character errors. If the string has an ampersand or other strange characters in it, the XML will be invalid. I tried using urlencode and htmlentities, but these don't capture all possible characters which need to be escaped. Does...

charset problem?

Hi all, I have a bugging problem. For a website I made there are search engine friendly URL's generated. The only problem is there are ß-chars in the url too. Chars like ö, ï, ä, ü etc. are placed correct. But with the ß-char there is a diamond-icon with a questionmark in it. I thought it had to do with the charset which is used but i'...

charset problem?

Hi all, I have a bugging problem. For a website I made there are search engine friendly URL's generated. The only problem is there are ß-chars in the url too. Chars like ö, ï, ä, ü etc. are placed correct. But with the ß-char there is a diamond-icon with a questionmark in it. -> � I thought it had to do with the charset which is used b...

Facebook Like Plugin HTML Entities

I installed the new Like plugin on my Wordpress blog. I also have the Open Graph Plugin for Wordpress installed. It all works magically except that the HTML special characters are showing on my Facebook Wall when I click like. I tried preventing the Open Graph plugin from encoding the content of the mega tag in the first place by editi...

php convert special character to ascii

Is there a built in function in php to convert special characters to it's ascii code? ...

How to convert all characters to their html entity equivalent using PHP

I want to convert this [email protected] to &#104;&#101;&#108;&#108;&#111;&#064;&#100;&#111;&#109;&#097;&#105;&#110;&#046;&#099;&#111;&#109; I have tried: url_encode($string) this provides the same string I entered, returned with the @ symbol converted to %40 also tried: htmlentities($string) this provides the same string righ...

php and special characters

Hi-- I'm trying to parse a string from a French text, and I'm using both htmlspecialchars and html_entity_decode-- but certain characters aren't getting properly converted. Any ideas? Here's the code: html_entity_decode(htmlspecialchars_decode($this->string($tstring))); // returned from web service In particular, the entity that isn...

htmlentities displaying html safely

I have data that is coming in from a rss feed. I want to be safe and use htmlentities but then again if I use it if there is html code in there the page is full of code and content. I don't mind the formatting the rss offers and would be glad to use it as long as I can display it safely. I'm after the content of the feed but also want it...

html_entity_decode() isn't working properly?

EDIT: I solved it seconds after posting the question (sorry!) but can't accept an answer yet. Hi folks, Just a quick one. I have a PHP/CodeIgniter site and the user can edit their profile. I'm using CI's XSS Filtering and Active Record-based Models, so the data is escaped automatically. It naturally displays fine on the profile page v...

Encoding in Java

Hi, I have a string with special characters in Java. "[^\\"]*\\" I want to convert it to HTML entities like this: &quot;[^\\&quot;]*\\&quot; How this could be achieved in Java? ...

joomla displaying html within the content

I have a joomla isntallation which displays some articles normally but when i added an article with a youtube video, the WYSIWYG editor converted the special characters in the embed code to html entities. Well, i'm assuming its the editor since it doesn't happen when i don't use it. The problem after is that if i go to the article, i se...

php form security

I was reading an article about form security becuase I have a form which a user can add messages. I read that it was best to use strip_tags(), htmlspecialchars() and nl2br() Somewhere else said to use html_entity_decode() I have this code in my page which takes the user input <?php $topicmessage = check_input($_POST['message']);...

Problem encoding multibyte characters with Perl's HTML::Entities

$perl -e 'use HTML::Entities; print encode_entities("<te£st>");' &lt;te&Acirc;&pound;st&gt; I'm expecting to see: &lt;te&pound;st&gt; ...