It seems I made my question get an answer that didn't exactly help.
I'm going to be more straightforward, someone can modify it if needed.
Do I need to modify the vulnerable function to make it work or do I need to use a better function, like I want to do?
Now, if I do use the better function, how specific do I want to make it. Is setting a charset going too far?