Skip to content

Instantly share code, notes, and snippets.

@GenbuHase
Last active May 2, 2016 10:00
Show Gist options
  • Save GenbuHase/ab9fcb32fecece0514fe19675872fc53 to your computer and use it in GitHub Desktop.
Save GenbuHase/ab9fcb32fecece0514fe19675872fc53 to your computer and use it in GitHub Desktop.
Unicode Inputer(Last Updated: 2016/04/12)

Unicode Inputer 説明書

1. 概要

Unicodeを使用して打消し文字などを生成するツールです。
勿論Unicode文字ですのでTwitterでも使うことが出来ます。

2. 使用特殊文字一覧

特殊文字記号 特殊文字
U+0304(772) ̄
U+0305(773) ̅
U+0331(817) ̱
U+0332(818) ̲
U+0335(821) ̵
U+0336(822) ̶
U+035E(862) ͞
U+035F(863) ͟

3. 著作権

無断転載・無断改変・二次配布を一切禁止いたします。
Copyright (C) 2016 Genbu Hase All Rights Reversed.

4. リンク

Unicode Inputer

<!DocType HTML>
<HTML>
<Head>
<Title>Unicode Inputer</Title>
<Script Type = "Text/JavaScript" Src = "https://bl.ocks.org/GenbuHase/raw/ab9fcb32fecece0514fe19675872fc53/Unicode Combine Helper Release 1.0.js"></Script>
<Script Type = "Text/JavaScript">
function Init() {
var Plain = document.getElementById("Plain");
var ShortOverlay = document.getElementById("ShortOverlay");
var LongOverlay = document.getElementById("LongOverlay");
var ShortOverline = document.getElementById("ShortOverline");
var LongOverline = document.getElementById("LongOverline");
var ShortLowline = document.getElementById("ShortLowline");
var LongLowline = document.getElementById("LongLowline");
with (new Combine()) {
ShortOverlay.value = toShortOverlay(Plain.value);
LongOverlay.value = toLongOverlay(Plain.value);
ShortOverline.value = toShortOverline(Plain.value);
LongOverline.value = toLongOverline(Plain.value);
ShortLowline.value = toShortLowline(Plain.value);
LongLowline.value = toLongLowline(Plain.value);
}
}
</Script>
</Head>
<Body>
<Form Method = "GET">
プレーンテキスト:<Input ID = "Plain" Type = "Text" Value = "" PlaceHolder = "文章を入れてください"><Input Type = "Button" Value = "反映" OnClick = "Init();"><Br>
打消し文章(短):<Input ID = "ShortOverlay" Type = "Text" Value = "" ReadOnly = "ReadOnly"><Br>
打消し文章(長):<Input ID = "LongOverlay" Type = "Text" Value = "" ReadOnly = "ReadOnly"><Br>
上線(短):<Input ID = "ShortOverline" Type = "Text" Value = "" ReadOnly = "ReadOnly"><Br>
上線(長):<Input ID = "LongOverline" Type = "Text" Value = "" ReadOnly = "ReadOnly"><Br>
下線(短):<Input ID = "ShortLowline" Type = "Text" Value = "" ReadOnly = "ReadOnly"><Br>
下線(長):<Input ID = "LongLowline" Type = "Text" Value = "" ReadOnly = "ReadOnly"><Br>
</Form>
</Body>
</HTML>
/*////////////////////////////////////////////////////////
*【Unicode Combine Helper Release 1.0】
* Copyright (C) 2016 Genbu Hase All Rights Reversed.
/*////////////////////////////////////////////////////////
var Combine = function () {
this.toPlain = function (Text) {
var Result = "";
for (var i = 0; i < Text.length; i++) {
if (Text.charCodeAt(i) >= 772 && Text.charCodeAt(i) <= 863) {
} else {
Result += Text.charAt(i);
}
}
return Result;
}
this.toShortOverlay = function (Text) {
var Result = "";
for (var i = 0; i < Text.length; i++) {
if (i == 0 && Text != "") {
Result = String.fromCharCode(821);
}
Result += Text.charAt(i) + String.fromCharCode(821);
}
return Result;
}
this.toLongOverlay = function (Text) {
var Result = "";
for (var i = 0; i < Text.length; i++) {
if (i == 0 && Text != "") {
Result = String.fromCharCode(822);
}
Result += Text.charAt(i) + String.fromCharCode(822);
}
return Result;
}
this.toShortOverline = function (Text) {
var Result = "";
for (var i = 0; i < Text.length; i++) {
Result += Text.charAt(i) + String.fromCharCode(772);
}
return Result;
}
this.toLongOverline = function (Text) {
var Result = "";
for (var i = 0; i < Text.length; i++) {
Result += Text.charAt(i) + String.fromCharCode(773);
}
return Result;
}
this.toShortLowline = function (Text) {
var Result = "";
for (var i = 0; i < Text.length; i++) {
Result += Text.charAt(i) + String.fromCharCode(817);
}
return Result;
}
this.toLongLowline = function (Text) {
var Result = "";
for (var i = 0; i < Text.length; i++) {
Result += Text.charAt(i) + String.fromCharCode(818);
}
return Result;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment