Mysql (1)

How to get a non-Latin slug from the address bar

By: Hossein Jalali • December 15, 2013

Sometimes when creating websites in Arabic or Farsi we are forced to accept slugs* that are non-Latin, These links usually look nice on the address bar but that is the only place they look good. Once we copy paste that URL and pass it on to others each character turns into a strange ASCII unit. 

Now that can also be acceptable if we were not going to use the slug, but in cases where we use that slug as an identifier for the article, news, or whatever it is associated with, then we have a problem. The problem is that our database has saved the slug in it's non-Latin form while when storing the slug as a variable it dispaly incorrectly.

This is where two lines of code comes in handy.

Read More