Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS [ UTF-8 ] problem #7

Open
h-rafiee opened this issue Dec 5, 2017 · 10 comments
Open

iOS [ UTF-8 ] problem #7

h-rafiee opened this issue Dec 5, 2017 · 10 comments

Comments

@h-rafiee
Copy link

h-rafiee commented Dec 5, 2017

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
Copy link
Owner

pH-7 commented Dec 5, 2017

Hi @h-rafiee

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

Can you paste your whole code here?

@h-rafiee
Copy link
Author

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
Copy link
Owner

pH-7 commented Dec 10, 2017

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

@pH-7
Copy link
Owner

pH-7 commented Dec 14, 2017

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
Copy link
Author

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
Copy link

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
Copy link
Owner

pH-7 commented Nov 7, 2018

@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 🤞

@renexx
Copy link

renexx commented Sep 3, 2021

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
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants