An error occurred translating the query string to UTF-16: No mapping for the Unicode |
Hi All,
I have a problem when using CI 2.14 or 2.1.0 with SQL Server 2012. I use sqlsrv for dbdriver. I got error massage like this when try to Login in my application. This error was happened when i was tried to input my password form with number, symbols and another else except character.If I only input password form with character everthing still working good. I have used google for solved my problem and only got this tutorial but I still got error when I tried http://stackoverflow.com/questions/91787...odeigniter Code: A Database Error Occurred This is my Model when insert to database PHP Code: public function validate(){ And this my file in Third Party folder for Encrypt and Decrpty User input password PHP Code: sory edited for any reason :D My question, is this a bug from CI driver for SQL Server ? And how to solved this problem, any advice to me ? This is make me painful Thank you
The whole code has more problems except the encoding.
1. You use encryption for passwords. Use hashing. 2. Your encryption algorithm is non-standard, super-weak, and it does not have separate secret data (a key) to be applied. By publishing its code here the encryption is already compromised. 3. To the concrete problem: You may encode the problematic strings using base64 before storing within the password field, on reading apply base64 decoding. This is not a solution, better try to refactor the whole password related code. (02-08-2015, 08:03 AM)ivantcholakov Wrote: The whole code has more problems except the encoding. Thank's for your reply, I have another problems, I can't change all value in the password field with base64 because the field passowrd has using by another application. If i change the password it will make big effect to anoher application Do you have any better idea ? What part of my code have to change to solved my problems ?
I think you have to convert the string into utf8 like this
PHP Code: iconv('','UTF-8',$EnkripsiUserPassword); |
Welcome Guest, Not a member yet? Register Sign In |