Skip to content

Instantly share code, notes, and snippets.



Last active May 22, 2017
What would you like to do?
[ruby] rQRCode Japanese string
# encoding: utf-8
require 'rqrcode'
require 'rqrcode_png'
str = '日本語てすと'
# QRコードで日本語を扱う場合はShift_JISが一般的
# 加えてライブラリの問題なのかASCII-8BITで渡さないとうまくいかない
qr_str = str.encode('CP932')
qrcode =, :size => 4, :level => :h)
qr_png = qrcode.to_img'test.png')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.