Skip to content

sjis2utf8 converts shift jis character into utf-8 on Processing.

Notifications You must be signed in to change notification settings

TetsuakiBaba/sjis2utf8

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sjis2utf8

sjis2utf8 converts shift jis character into utf-8 character with shift-jis to utf-8 with a hashmap. It works on Processing.

PFont font;
Encoder encoder;
void setup()
{
  size(500,500);
    // 日本語フォントを作成し指定する
  font = createFont("ipag.ttf", 72, true);
  textFont(font);
  textSize(72);
   textAlign(CENTER, CENTER);
   
   encoder = new Encoder();
   encoder.setup();
   
}

void draw()
{
  background(255);
  fill(0);
  // SJIS CODE(語) = 0x8CEA is converted 3 bytes UTF(0xE8AA9E) string type
  // 日本 is typed in UTF-8 character.
  String str = "日本" + encoder.getUtfString(byte(0x8C), byte(0xEA));
  text(str, width/2, height/2);
   
}

About

sjis2utf8 converts shift jis character into utf-8 on Processing.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published