Forum Moderators: coopster

Message Too Old, No Replies

Convert characters to CSS Unicode Entities using PHP

         

thijsnetwork

11:44 am on Aug 27, 2006 (gmt 0)

10+ Year Member



Hi,

I would like to have some special characters in a "content"-property of a CSS2 pseudo-element. Special characters must be escaped as stated here:

[w3.org...]

Does anybody know how I can use PHP to convert special characters to their ISO-10646 entities?

[edited by: jatar_k at 2:28 pm (utc) on Aug. 27, 2006]
[edit reason]
[1][edit reason] linked it up [/edit]
[/edit][/1]

coopster

3:03 pm on Sep 7, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



According to the link ...

Note that Unicode is code-by-code equivalent to ISO 10646

It seems that PHP6 is going to finally fill some gaps in this respect with it's Unicode Functions [php.net]:


Introduction 
============

As successful as PHP has proven to be in the past several years, it is still 
the only remaining member of the P-trinity of scripting languages - Perl and
Python being the other two - that remains blithely ignorant of the
multilingual and multinational environment around it. The software
development community has been moving towards Unicode Standard for some time
now, and PHP can no longer afford to be outside of this movement. Surely,
some steps have been taken recently to allow for easier processing of
multibyte data with the mbstring extension, but it is not enabled in PHP by
default and is not as intuitive or transparent as it could be.

The basic goal of this document is to describe how PHP 6 will support the 
Unicode Standard natively. Since the full implementation of the Unicode
Standard is very involved, the idea is to use the already existing,
well-tested, full-featured, and freely available ICU (International
Components for Unicode) library. This will allow us to concentrate on the
details of PHP integration and speed up the implementation.

Resource:
[zend.com...]

So according to the text here the Multibyte String Functions [php.net] might be your best option for now. Hopefully I'm not off track here. Anybody else care to chime in ...?