File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11//---------------------------------------------------------------------
22//
3- // QR Code Generator for JavaScript SJIS Support (optional)
3+ // QR Code Generator for JavaScript UTF8 Support (optional)
44//
55// Copyright (c) 2011 Kazuhiko Arase
66//
2020 //---------------------------------------------------------------------
2121 // overwrite qrcode.stringToBytes
2222 //---------------------------------------------------------------------
23+
2324 qrcode . stringToBytes = function ( s ) {
2425 // http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array
2526 function toUTF8Array ( str ) {
4344 // subtracting 0x10000 and splitting the
4445 // 20 bits of 0x0-0xFFFFF into two halves
4546 charcode = 0x10000 + ( ( ( charcode & 0x3ff ) << 10 )
46- | ( str . charCodeAt ( i ) & 0x3ff ) )
47+ | ( str . charCodeAt ( i ) & 0x3ff ) ) ;
4748 utf8 . push ( 0xf0 | ( charcode >> 18 ) ,
4849 0x80 | ( ( charcode >> 12 ) & 0x3f ) ,
4950 0x80 | ( ( charcode >> 6 ) & 0x3f ) ,
5455 }
5556 return toUTF8Array ( s ) ;
5657 } ;
57-
58+
5859} ( qrcode ) ;
You can’t perform that action at this time.
0 commit comments