For your particular case, it does not seem that it is as easy to perform SQL injection, but a common thing to try is something like, if i enter a unicode null variable? like \0
? Will it break the script and return everything? Most likely not.
So thing is, you do not always need slashes to perform SQL injection. Some SQL can be written so horrible wrong, heres an example
"SELECT * FROM admins WHERE id = $id"
If $id
is a number, its perfectly valid SQL, and you perform addslashes
on $id, (who would do that anyway?). But for this specific case, all you need for SQL injection is 1 OR 1=1
making the query look like
"SELECT * FROM admins WHERE id = 1 OR 1=1"
There is no way addslashes
or magic_quotes
could protect you against that sort of stupidity.
To get back to the question at hand, why would anyone in their right mind ever use GBK
over something like UTF-8
or UTF-16
?