Tag Archives: Encoding

CSS character escape sequences, more on the CSS3 selector syntax (STTS 3 Profile Specification) at W3C.

Posted on by hakre | Leave a comment

htmlspecialchars() improvements in PHP 5.4; the PHP default_charset is here. Input has left untouched so far, first assumable is output encoding will lead to input encoding. But can’t resolve the general dilemma of unknown input encoding for your webapp. See … Continue reading

Posted on by hakre | Leave a comment

PHP UTF-8 String Length

If you’ve got an UTF-8 encoded PHP string (e.g. when working with DOMDocument) and you don’t want to rely on the mbstring extension to get it’s length, this can be solved with a simple regular expression (as the string does … Continue reading

Posted in PHP Development, PHP Library, Pressed, The Know Your Language Department | Tagged , , , , , , , , | 1 Comment

Substitutes for PHP 5.4’s htmlspecialchars.

See UPGRADING

Posted in Hakre's Tips, Pressed | Tagged , , , | Leave a comment

Best Practice robots.txt

I did some research month ago and wrote a longer article about robots.txt. But for a quick lookup it’s too much to read, so today it’s time a for a simple best-practices check-list: Use ASCII encoding for robots.txt (see as … Continue reading

Posted in Pressed, Surviving the Internet | Tagged , , , , , | 2 Comments

Encode a PHP String

Today I updated PHPMyadmin on one of my boxes. Nothing special so far, but I saw that it’s now possible to export data in form of a PHP array. Well I thought that’s somehow nice. But the plugin was broken. … Continue reading

Posted in Pressed | Tagged , , , | Leave a comment

Verify file encoding with grep

List all lines in PHP-files in a directory-tree that contain characters out of the ASCII 7Bit pane: ~ grep -nPR –include=*.php [\xE0-\xFF] * Does a quick and easy controlling on a full package of files quickly. Finds stuff like this … Continue reading

Posted in Hacking The Core, Hakre's Tips, Pressed | Tagged , , , , | Leave a comment

Line Endings in diverse Operating Systems

While coding some XML stuff lately (if you’re into PHP and XML, get a grip on FluentDOM if you have not already) I ran about some line ending issues. That [NEL] thingy was new to me, so I just wanted … Continue reading

Posted in Hakre's Tips, Pressed | Tagged , , , , , , , , | Leave a comment

HTML Entity Boundaries – Zero Padding

I can not say why, but the HTML specification does allow to zero-pad numerical entities [Reference needed]. Well that sounds fair per-se, but it does not give a limit here. So strictly spoken, you can pad your numeric entities with … Continue reading

Posted in Hacking The Core, Hakre's Tips, Pressed | Tagged , , , , , | 1 Comment