mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-22 02:44:27 +00:00
:octocat: improved Kanji validation (fingers crossed)
This commit is contained in:
@@ -32,6 +32,7 @@ abstract class QRDataModeAbstract implements QRDataModeInterface{
|
||||
* @throws \chillerlan\QRCode\Data\QRCodeDataException
|
||||
*/
|
||||
public function __construct(string $data){
|
||||
$data = $this::convertEncoding($data);
|
||||
|
||||
if(!$this::validateString($data)){
|
||||
throw new QRCodeDataException('invalid data');
|
||||
@@ -61,4 +62,13 @@ abstract class QRDataModeAbstract implements QRDataModeInterface{
|
||||
return Mode::getLengthBitsForVersion(static::$datamode, $versionNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
* encoding conversion helper
|
||||
*
|
||||
* @throws \chillerlan\QRCode\Data\QRCodeDataException
|
||||
*/
|
||||
public static function convertEncoding(string $string):string{
|
||||
return $string;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user