OpenInviter and UTF8 encoding January 17, 2011

If you need to import contacts from other services there is quite good cheap solution for PHP – open source library www.openinviter.net. It supports a huge amount of services and that’s awesome.

There is nice auto-installer and documentation. Here I just want to discuss an issue that you can experience – incorrect encoding of russian contact names.

To solve it replace in OpenInviter base class the following line:

$name=trim((!empty($arrayImport[‘first_name’])?$arrayImport[‘first_name’]:false).‘ ‘.(!empty($arrayImport[‘middle_name’])?$arrayImport[‘middle_name’]:false).‘ ‘.(!empty($arrayImport[‘last_name’])?$arrayImport[‘last_name’]:false).‘ ‘.(!empty($arrayImport[‘nickname’])?$arrayImport[‘nickname’]:false));

with

$name=utf8_decode(trim((!empty($arrayImport[‘first_name’])?$arrayImport[‘first_name’]:false).‘ ‘.(!empty($arrayImport[‘middle_name’])?$arrayImport[‘middle_name’]:false).‘ ‘.(!empty($arrayImport[‘last_name’])?$arrayImport[‘last_name’]:false).‘ ‘.(!empty($arrayImport[‘nickname’])?$arrayImport[‘nickname’]:false)));
 
3 Comments
pengjuanjuan September 14th, 2011

thank you!

 
Mary Albanese April 3rd, 2012

Hi- I would like to use Open Inviter. I went to the website and I could see the first page fine. However, when I clicked to register, or I clicked to see the blog, the webpage came up completely full of strange characters (like boxes). I tried it on IE, firefox and safari and same problem. I tried changing the encoding but no good.
Can you help me?

I live in US

 
klalex April 17th, 2012

Mary, try to contact support at http://openinviter.com/contact.php. After logging in I could download it without a problem.

 
Leave a Reply