An error occurred translating the query string to UTF-16: No mapping for the Unicode - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: Issues (https://forum.codeigniter.com/forumdisplay.php?fid=19) +--- Thread: An error occurred translating the query string to UTF-16: No mapping for the Unicode (/showthread.php?tid=1049) |
An error occurred translating the query string to UTF-16: No mapping for the Unicode - projack89 - 02-08-2015 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/9178795/how-to-store-multi-byte-characters-in-sql-server-database-using-codeigniter 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 RE: An error occurred translating the query string to UTF-16: No mapping for the Unicode - ivantcholakov - 02-08-2015 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. RE: An error occurred translating the query string to UTF-16: No mapping for the Unicode - projack89 - 02-08-2015 (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 ? RE: An error occurred translating the query string to UTF-16: No mapping for the Unicode - ivantcholakov - 02-08-2015 I am out of ideas, this looks tricky to be solved from distance. RE: An error occurred translating the query string to UTF-16: No mapping for the Unicode - Rufnex - 02-09-2015 I think you have to convert the string into utf8 like this PHP Code: iconv('','UTF-8',$EnkripsiUserPassword); |