Bacon / BaconQrCode

QR Code Generator for PHP
BSD 2-Clause "Simplified" License
1.86k stars 212 forks source link

QR code Generation fails depending on locale #83

Open bardiir opened 3 years ago

bardiir commented 3 years ago

The QR code generation does fail, depending on the locale if the decimal separator is not defined as a point.

This is caused by the library generating comma separated numbers in places where a point value is expected, for example <g transform="scale(10,811)"> instead of <g transform="scale(10.811)"> on de_DE as the float is transformed with a comma as a decimal separator by the sprintf including it as a string, basically casting float to string in the process.

Imagick png is also affected by the locale, although I haven't figured out exactly why yet.

DASPRiD commented 3 years ago

PR https://github.com/Bacon/BaconQrCode/pull/68 tried to address this issue, but the author never followed up on the required changes. Feel free to create a new PR for that.

bardiir commented 3 years ago

https://github.com/Bacon/BaconQrCode/pull/84

dictacode commented 2 years ago

I have the same problem, my app works fine until i change the locale settings.