What does set_locale(LC_CTYPE, 'C'); actually do?
C
means "use whatever locale is hard coded" (and since most *NIX programs are written in C, it's called C
). However, it is usually not an UTF-8 locale.
If you are using multibyte charsets such as UTF-8 you cannot use the regular string functions - using the mb_
counterparts is required. However, almost every PHP installation should have this extension enabled.