This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| process.env.PYTHONIOENCODNG = "utf-8"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Display bytes in String | |
| puts "- utf-8 ------------------------------" | |
| 'あ'.bytes { |b| puts "#{b.to_s(16)} => #{sprintf("%#010b", b)}" } | |
| puts "- sjis ------------------------------" | |
| 'あ'.encode("Windows-31J").bytes { |b| puts "#{b.to_s(16)} => #{sprintf("%#010b", b)}" } | |
| puts "- utf-16le ---------------------------" | |
| 'あ'.encode("utf-16le").bytes { |b| puts "#{b.to_s(16)} => #{sprintf("%#010b", b)}" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # TrueTypeフォントより登録用のモノクロビットマップ 256x256 を抽出 | |
| from PIL import Image, ImageDraw, ImageFont | |
| # path to *.ttf | |
| ttf_path = './EUDC.TTF' | |
| # 抽出したいコードポイント E000 to F2B3 | |
| cp_start = 57344 | |
| cp_end = 62131 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # coding: utf-8 | |
| File.open("hoge.txt", "w:utf-16le") do |output| | |
| #----------------------------------------------------- | |
| # added BOM for handling NIHONGO file | |
| output.print [0xfffe].pack("U") | |
| #----------------------------------------------------- | |
| 7.times do |i| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var util = require("util"); | |
| util.puts("\u0041"); // "A" | |
| var codePoint = "A".charCodeAt(0); | |
| util.puts(codePoint.toString(16)); // "41" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "sqlite3" | |
| db = SQLite3::Database.new("test.sqlite3") | |
| sql = <<SQL | |
| create table test( | |
| content blob | |
| ) | |
| SQL | |
| db.execute_batch(sql) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Hash | |
| class MyClass | |
| def initialize | |
| @config = { | |
| name: "default name", | |
| mail: "default mail" | |
| } | |
| end | |
| def set_config |