Jump to content

Domain contacts and UTF-8


hexonet

Recommended Posts

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 '' (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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated