How Do You Sort Chinese Numbers?


Imagine you have a series of number you wish to sort. Sorting is a well known computer science problem - generally speaking you compare one value to the next and then move the item either up or down a list. With "English" characters, that's fairly easy. When a computer sees the character 1 it's really […]

Continue reading →

Why can't you send email to a Chinese address?


We all know what an email address looks like and how to validate them, right? A few years ago I got the Chinese domain name 莎士比亚.org. You can browse to it, link to it, and send email to it. Or can you? When I tried two years ago, none of the major email providers supported […]

Continue reading →

Counting Invisible Strings


The PHP logo.

When is a string not a string? When it's a series of control characters! Not a particularly funny riddle, but one I've been wrestling with recently. Imagine we want to write a program which displays a Twitter user's name. Not their @ handle, but their "real" name. For example, instead of @POTUS, display "President Obama". […]

Continue reading →

How to type Emoji in Ubuntu


New tech site Gadgette has a great article on how to type Emoji on Mac and Windows - but they (understandably) didn't cover Ubuntu. So here I am to show you how. Get The Fonts If your computer doesn't have the requite font, install the latest version of Symbola. Simply open up the .zip file, […]

Continue reading →

Twitter's Weird Control Character Handling


A little curio for you all. A StackOverflow user has pointed out that certain Twitter profiles contain very odd Unicode characters. What on Earth is going on? Let's take a look at Bill Clinton's profile on Twitter. Ok, that looks pretty normal. But let's take a look at the HTML source. Huh... What are those […]

Continue reading →

Searching For A Smile


What happens if you search the web for the Unicode character "☺"? On the one hand, it's a symbol just like the letter A or the punctuation mark "!" - on the other, it contains semantic meaning. A smiling, happy face. I decided to look at a few popular search engines to see what they'd […]

Continue reading →

Facebook Mangles Unicode URLs


Facebook rewrite URLs with Unicode in the path - this is not best practice and could be dangerous. It is possible to create a URL like http://bit.ly/😀 - the Unicode characters are valid in the path. The URL Encoded representation is : bit.ly/%F0%9F%98%80 Facebook mangles these URLs in such a way that it might be […]

Continue reading →

Evading Profanity Filters Using Bi-Directional Text


There are some very sensitive souls on the Internet who object to seeing swear words. To that end, a huge industry has sprung up around "Profanity Filters" - services which claim to be able to detect naughty words and automatically redact them. The approach of dumbly looking for strings of text leads to a range […]

Continue reading →

RTL Bugs


Take a look at the following text, looks normal enough doesn't it? "Harry ‮".draziw a si ‭Potter Now, try to select the text and see what happens. WHAT WITCHCRAFT IS THIS?! If you examine the source code for this page, you'll see that I'm using the Unicode Bi-Directional characters. "Harry ‮".draziw a si ‭Potter These […]

Continue reading →

Homoglyph Attacks


Homoglyphs are characters that love each other very much look strikingly similar to each other. Can you quickly tell the difference between these two - O0? That's The capital letter "o" and the number 0. How about Il1|? Depending on the font used - and your attention to detail, it may be hard to spot […]

Continue reading →