How can i get the encoding of a string?
The idea is to prevent users from regestring with funny usernames on my site, because i get usernames like: öüõäÖÜõ
Thank you.
With multibyte support, you can use [man]mb_detect_encoding[/man]. You'd probably be better off just limiting the available characters in the string. Most commonly, people will just allow a-z, 0-9, underscores, maybe spaces...
Thank you for your reply!
How do i limit the available characters in the string ?
Using regex, or [man]ctype_alnum/man in the C locale if you're just going to allow alphanumeric characters.