1
ห้อง MS Access / : สร้าง QR Code
« เมื่อ: 25 พ.ค. 61 , 11:38:54 »
***สอบถามเพิ่มเติมค่ะ
ถ้าต้องการให้ QR code สามารถอ่านรองรับภาษาญี่ปุ่นได้ด้วยมีวิธียังไงบ้างคะ
เช่นรหัส 050078801CS ギャクシベンスプール สามารถสร้างQR Code ได้
แต่ตอนอ่าน ไม่รองรับภาษาญี่ปุ่น จะแสดงเป็น ???แทนค่ะ
อยากทราบว่าโค้ดตรงโมดูลนี้ ต้องเปลี่ยนชนิดเป็น Shift_JIS ตรงไหน
ปล. ด้านล่างนี้เป็นตัวอย่างที่เป็นปัญหาที่เจอมาค่ะ
ถ้าต้องการให้ QR code สามารถอ่านรองรับภาษาญี่ปุ่นได้ด้วยมีวิธียังไงบ้างคะ
เช่นรหัส 050078801CS ギャクシベンスプール สามารถสร้างQR Code ได้
แต่ตอนอ่าน ไม่รองรับภาษาญี่ปุ่น จะแสดงเป็น ???แทนค่ะ
อยากทราบว่าโค้ดตรงโมดูลนี้ ต้องเปลี่ยนชนิดเป็น Shift_JIS ตรงไหน
โค๊ด: [Select]
Public Function QRGen(Plain_Text As String)
Dim RowCount As Long, ColCount As Long, i As Long, j As Long
Dim Message As String, EncodedMsg As String
Message = Plain_Text
Call QRCodeEncode(Message, Version, Level, Mask)
RowCount = QRCodeGetRows()
ColCount = QRCodeGetCols()
For i = 1 To RowCount
For j = 1 To ColCount
EncodedMsg = EncodedMsg & Chr(QRCodeGetCharAt(i - 1, j - 1))
Next j
EncodedMsg = EncodedMsg & vbCrLf
Next i
QRGen = EncodedMsg
End Function
ปล. ด้านล่างนี้เป็นตัวอย่างที่เป็นปัญหาที่เจอมาค่ะ
อ้างถึง
I'm trying to encode with Shift_JIS but my qr code does not match the
output shown by the Zxing Code Generator Page (http://
zxing.appspot.com/generator/).
The test string is:
1234567890お客様名ABCDEabcdeアイウエオ鰺鯵
My code looks like this:
QRCode qrcode = new QRCode();
Hashtable<EncodeHintType, String> hints = new
Hashtable<EncodeHintType, String>(2);
hints.put(EncodeHintType.CHARACTER_SET, "Shift_JIS");
Encoder.encode(contents, ecLevel, hints, qrcode);
My result matches the UTF-8 qr code generated on the generator page
instead of the Shift_JIS qr code.
I've tried encoding the string to Shift_JIS before the Encoder.encode
call but that results in the same UTF-8 qr code.
โพสต์นี้ได้รับคำขอบคุณจาก: anek_TH