pH-7 / QRCode-Generator-PHP-Class

:rocket: QRCode PHP class (library). QR Code Generator using vCard 4.0 and the Google Chart API
http://github.com/pH-7/QRCode-Generator-PHP-Class
GNU General Public License v3.0
98 stars 53 forks source link

iOS [ UTF-8 ] problem #7

Open h-rafiee opened 6 years ago

h-rafiee commented 6 years ago

Hello my friend its work as beautiful in Android > 5.0 but it not work in iOS its work but sames have problem with Unicode ...

pH-7 commented 6 years ago

Hi @h-rafiee

What's the text you used? Maybe you used some special characters...

Can you paste your whole code here?

h-rafiee commented 6 years ago

i use Persian Keyboard. in Android work but we have issue in iOS Unicode "UTF-8" not supported and we'll see as ASCII

pH-7 commented 6 years ago

Okay, can you show your code here so I can try to reproduce your issue on my end.

pH-7 commented 6 years ago

Hi again @h-rafiee I will be able to help you if you post your code sample that doesn't work, otherwise I won't be able to replicate the same issue than you. Thanks for understanding

h-rafiee commented 6 years ago

OK :)

$oQRC = new QRCode;
$oQRC->fullName($this->setting[$this->session->_gdb]['title']) // Add Full Name
                ->gender('M') // Add Gender
                ->url('http://google.com') // Add URL Website
                ->address($this->setting[$this->session->_gdb]['address'])
                ->note(mb_word_wrap($this->setting[$this->session->_gdb]['description'],150,'...')) 
                ->photo(base_url($this->setting[$this->session->_gdb]['logo_other']));
$params = json_decode($this->setting[$this->session->_gdb]['params']);
foreach (explode("-",$params->phone) as $phone){
            $oQRC->workPhone($phone);
}
$oQRC->finish();
$data['oQRC']=$oQRC;

that will such as :

$oQRC = new QRCode;
$oQRC->fullName(" حسین رفیعی ") // Add Full Name
                ->gender('M') // Add Gender
                ->url('http://google.com') // Add URL Website
                ->address(" ایران ")
                ->note(" یک برنامه نویس ") 
                ->photo("http://mysite.com/images/aasdasd.jpg");
$oQRC->workPhone(" +989388916366 ");
$oQRC->finish();
$data['oQRC']=$oQRC;
 <img src="<?=$oQRC->get(200)?>" >
guiperalta commented 5 years ago

Same issue here, but with brazillian portuguese, just a test to see if the name was accepted but no luck. Is there a way to set encoding as UTF-8?

`$oQRC->fullName('João Carlos Abraão')// Add Full Name`

iphone2

pH-7 commented 5 years ago

@h-rafiee This library uses Google chart API, and it encodes to UTF-8 by default https://developers.google.com/chart/infographics/docs/qr_codes#syntax

Otherwise, you can change the encoding to another one by mentioning the parameter choe=<output_encoding> in https://github.com/pH-7/QRCode-Generator-PHP-Class/blob/master/QRCode.class.php#L335

Hope this will help :crossed_fingers:

renexx commented 3 years ago

Hello, I have the same problem. On android works perfect but on IOS devices doesn't work. The problem is in the constructor, there is VERSION 4.0 , but IOS devices doesn't support this Version. When I change Version to 3.0 everything works perfect. Therefore, I think version should be 3.0 for perfect working on both devices.

SooZoodimp commented 1 year ago

Hello. I had problems with czech diacritics.

Using php function utf8_encode in function finish() helped.

public function finish() { $this->sData .= 'END:VCARD'; $this->sData = urlencode(utf8_encode($this->sData)); return $this; }

SooZoodimp commented 1 year ago

I am sorry ... just realized it didn't work on iOS.