hexonet Posted January 19, 2010 Share Posted January 19, 2010 Hi, does WHMCS convert special characters in contact data, before sending to the registrar module? There seems to be a bug, as it does normalize utf8 chars bytewise. This could work with latin1, but with utf-8, it fails ($mysql_charset = "utf8"; in configuration.php makes no difference). E.g. an utf8-'ü' is represented as 'ü' (2 bytes), but then normalized to 'A¼' (still 2 bytes, but invalid as utf8 ). Is it possible to deactivate this behaviour, as our api is able to handle utf-8. Also some registries like .de and .eu fully support special chars in contact handles. Best, -jens 0 Quote Link to comment Share on other sites More sharing options...
xister Posted January 20, 2010 Share Posted January 20, 2010 i can confirm this bug. 0 Quote Link to comment Share on other sites More sharing options...
hexonet Posted January 20, 2010 Author Share Posted January 20, 2010 Thank you! Would it be a solution for WHMCS to deactivate the character mapping, if utf-8 is used? Right now, it doesn't work for utf8, so it would not raise new issues then, but resolve some imho. 0 Quote Link to comment Share on other sites More sharing options...
HerrZ Posted January 20, 2010 Share Posted January 20, 2010 hi, does WHMCS convert special characters in contact data yes, it does (wrong). this should be the same issue like here ( http://forum.whmcs.com/showthread.php?t=7399#6 ). Read this first. Your Database must be utf-8. My Solution is (for Pleskmodule, but registrar should be the same): first: in the controller funcs do not use the $params array for username,firstname, lastname,companyname,phonenumber,email,address1,city,postcode,country in TEMPLATE_CreateAccount() (or the other create stuff) use: $myuserdetails = TEMPLATE_get_myuserdetails($params['clientsdetails']['userid']); // utf-8 userdetails from DB not the ASCII stuff from core and use $myuserdetails['firstname'] for example in your code. add the following function to your module: function TEMPLATE_get_myuserdetails($user_id) { $query = mysql_query("SELECT firstname, lastname, companyname, address1, address2, city, state, postcode, country, email, phonenumber, ip FROM tblclients WHERE id = '" . (int)$user_id . "'"); $result = mysql_fetch_array($query); return $result; } i think, thats it. 0 Quote Link to comment Share on other sites More sharing options...
hexonet Posted January 20, 2010 Author Share Posted January 20, 2010 Thank you for the hint, HerrZ! I'll implement a workaround for our registrar module: If "Charset" == "utf-8" in tblconfiguration, then it should overwrite the respective contact values in $params, using tblorders, tblcontacts and tblclients as sources. Best, - jens 0 Quote Link to comment Share on other sites More sharing options...
hexonet Posted January 21, 2010 Author Share Posted January 21, 2010 I just posted an updated registrar module which supports UTF-8 for domain registrations, transfers and contact changes. Using that, you can e.g. register a .com domain with chinese characters in the registrant handle, or an .eu domain with german umlauts in the registrant name, so that they get displayed correctly in EURid's whois. Best, -jens 0 Quote Link to comment Share on other sites More sharing options...
HerrZ Posted January 21, 2010 Share Posted January 21, 2010 Mr. Hexonet means this one: http://forum.whmcs.com/showthread.php?t=26428#6 anyway, nice work! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.