JS歷理 特殊符號轉義十進位制編

onestopweb發表於2024-05-30
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>JS 特殊符號轉義十進位制編碼</title>
</head>
<body>
<script type="text/javascript">
//010003 JS 特殊符號表
function toUnicode(str) {
    var result = '';
    var temp = '';
    for (var i=0; i<test.length; i++) {
        temp = test.charCodeAt(i).toString(10);
        result += '&#'+temp+';:&amp;#' +temp+';<br>';
    }
    return result;
}

var title ='數學符號:';
var test = '+−×÷±=<>≤≥≈≅≠≮≯≡()[]{}∶∵∴∷㏒㏑∑∏∅√∛∜∠%‰‱^';
document.write(title+'<br>');
document.write(toUnicode(test)+'<br>');

var title ='鋼筋符號:';
var test = 'ABCE@Φφ';
/**
 * A:一級鋼
 * B:二級鋼
 * C:三級鋼
 * E:四級鋼
 * @:鋼筋間距
 * Φ:鋼筋直徑
 * φ:Φ的小寫,不建議使用
 * */
document.write(title+'<br>');
document.write(toUnicode(test)+'<br>');

/**
 * 建築物橫向排列的軸線稱為橫軸(由西到東排列,又稱X軸axisX),常用阿拉伯數字表示, 注意區別與軸線本身的方向性;
 * 建築物縱向排列的軸線稱為縱軸(由南到北排列,又稱Y軸axisY),常用字母表示,注意I、O、Z不用作軸線編號;
 * 兩相鄰橫軸之間的牆,稱為橫牆,間距即為開間;
 * 兩相鄰縱軸之間的牆,稱為縱軸,間距即為進深;
 * */
var title ='(X軸橫軸)圓圈數字序號:';
var test = '⓪①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲⑳㉑㉒㉓㉔㉕㉖㉗㉘㉙㉚';
document.write(title+'<br>');
document.write(toUnicode(test)+'<br>');

var title ='(Y軸縱軸)圓圈字母序號:';
var test = '㊣ⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏ';
document.write(title+'<br>');
document.write(toUnicode(test)+'<br>');

var title ='羅馬數字序號:';
var test = 'ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ';
document.write(title+'<br>');
document.write(toUnicode(test)+'<br>');

var title ='單位符號:';
var test = '°℃㎎㎏㎜㎝㎞㎡m³㏄ml¥$′″';
document.write(title+'<br>');
document.write(toUnicode(test)+'<br>');

var title ='分數符號:';
var test = '½⅓⅔¼¾⅕⅖⅗⅘⅙⅚⅛⅜⅝⅞⅟';
document.write(title+'<br>');
document.write(toUnicode(test)+'<br>');

var title ='上標符號:';
var test = '⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾ᵃᵇᶜᵈᵉᶠᵍʰⁱʲᵏˡᵐⁿᵒᵖʳˢᵗᵘᵛʷˣʸᶻᴬᴮᴰᴱᴳᴴᴵᴶᴷᴸᴹᴺᴼᴾᴿᵀᵁᵂ˙';
document.write(title+'<br>');
document.write(toUnicode(test)+'<br>');

var title ='下標符號:';
var test = '₀₁₂₃₄₅₆₇₈₉₊₋₌₍₎ₐₔₑᵢₒᵣᵤᵥₓᵤᵩᵦₒᵨᵤᵪᵧᴀʙᴄᴅᴇғɢʜɪᴊᴋʟᴍɴᴏᴘǫʀsᴛᴜᴠᴡxʏᴢ';
document.write(title+'<br>');
document.write(toUnicode(test)+'<br>');

</script>
</body>
</html>

效果圖:

數學符號:
+:&#43;
−:&#8722;
×:&#215;
÷:&#247;
±:&#177;
=:&#61;
<:&#60;
>:&#62;
≤:&#8804;
≥:&#8805;
≈:&#8776;
≅:&#8773;
≠:&#8800;
≮:&#8814;
≯:&#8815;
≡:&#8801;
(:&#40;
):&#41;
[:&#91;
]:&#93;
{:&#123;
}:&#125;
∶:&#8758;
∵:&#8757;
∴:&#8756;
∷:&#8759;
㏒:&#13266;
㏑:&#13265;
∑:&#8721;
∏:&#8719;
∅:&#8709;
√:&#8730;
∛:&#8731;
∜:&#8732;
∠:&#8736;
%:&#37;
‰:&#8240;
‱:&#8241;
^:&#94;

鋼筋符號:
A:&#65;
B:&#66;
C:&#67;
E:&#69;
@:&#64;
Φ:&#934;
φ:&#966;

(X軸橫軸)圓圈數字序號:
⓪:&#9450;
①:&#9312;
②:&#9313;
③:&#9314;
④:&#9315;
⑤:&#9316;
⑥:&#9317;
⑦:&#9318;
⑧:&#9319;
⑨:&#9320;
⑩:&#9321;
⑪:&#9322;
⑫:&#9323;
⑬:&#9324;
⑭:&#9325;
⑮:&#9326;
⑯:&#9327;
⑰:&#9328;
⑱:&#9329;
⑲:&#9330;
⑳:&#9331;
㉑:&#12881;
㉒:&#12882;
㉓:&#12883;
㉔:&#12884;
㉕:&#12885;
㉖:&#12886;
㉗:&#12887;
㉘:&#12888;
㉙:&#12889;
㉚:&#12890;

(Y軸縱軸)圓圈字母序號:
㊣:&#12963;
Ⓐ:&#9398;
Ⓑ:&#9399;
Ⓒ:&#9400;
Ⓓ:&#9401;
Ⓔ:&#9402;
Ⓕ:&#9403;
Ⓖ:&#9404;
Ⓗ:&#9405;
Ⓘ:&#9406;
Ⓙ:&#9407;
Ⓚ:&#9408;
Ⓛ:&#9409;
Ⓜ:&#9410;
Ⓝ:&#9411;
Ⓞ:&#9412;
Ⓟ:&#9413;
Ⓠ:&#9414;
Ⓡ:&#9415;
Ⓢ:&#9416;
Ⓣ:&#9417;
Ⓤ:&#9418;
Ⓥ:&#9419;
Ⓦ:&#9420;
Ⓧ:&#9421;
Ⓨ:&#9422;
Ⓩ:&#9423;

羅馬數字序號:
Ⅰ:&#8544;
Ⅱ:&#8545;
Ⅲ:&#8546;
Ⅳ:&#8547;
Ⅴ:&#8548;
Ⅵ:&#8549;
Ⅶ:&#8550;
Ⅷ:&#8551;
Ⅸ:&#8552;
Ⅹ:&#8553;
Ⅺ:&#8554;
Ⅻ:&#8555;

單位符號:
°:&#176;
℃:&#8451;
㎎:&#13198;
㎏:&#13199;
㎜:&#13212;
㎝:&#13213;
㎞:&#13214;
㎡:&#13217;
m:&#109;
³:&#179;
㏄:&#13252;
m:&#109;
l:&#108;
¥:&#165;
$:&#36;
′:&#8242;
″:&#8243;

分數符號:
½:&#189;
⅓:&#8531;
⅔:&#8532;
¼:&#188;
¾:&#190;
⅕:&#8533;
⅖:&#8534;
⅗:&#8535;
⅘:&#8536;
⅙:&#8537;
⅚:&#8538;
⅛:&#8539;
⅜:&#8540;
⅝:&#8541;
⅞:&#8542;
⅟:&#8543;

上標符號:
⁰:&#8304;
¹:&#185;
²:&#178;
³:&#179;
⁴:&#8308;
⁵:&#8309;
⁶:&#8310;
⁷:&#8311;
⁸:&#8312;
⁹:&#8313;
⁺:&#8314;
⁻:&#8315;
⁼:&#8316;
⁽:&#8317;
⁾:&#8318;
ᵃ:&#7491;
ᵇ:&#7495;
ᶜ:&#7580;
ᵈ:&#7496;
ᵉ:&#7497;
ᶠ:&#7584;
ᵍ:&#7501;
ʰ:&#688;
ⁱ:&#8305;
ʲ:&#690;
ᵏ:&#7503;
ˡ:&#737;
ᵐ:&#7504;
ⁿ:&#8319;
ᵒ:&#7506;
ᵖ:&#7510;
ʳ:&#691;
ˢ:&#738;
ᵗ:&#7511;
ᵘ:&#7512;
ᵛ:&#7515;
ʷ:&#695;
ˣ:&#739;
ʸ:&#696;
ᶻ:&#7611;
ᴬ:&#7468;
ᴮ:&#7470;
ᴰ:&#7472;
ᴱ:&#7473;
ᴳ:&#7475;
ᴴ:&#7476;
ᴵ:&#7477;
ᴶ:&#7478;
ᴷ:&#7479;
ᴸ:&#7480;
ᴹ:&#7481;
ᴺ:&#7482;
ᴼ:&#7484;
ᴾ:&#7486;
ᴿ:&#7487;
ᵀ:&#7488;
ᵁ:&#7489;
ᵂ:&#7490;
˙:&#729;

下標符號:
₀:&#8320;
₁:&#8321;
₂:&#8322;
₃:&#8323;
₄:&#8324;
₅:&#8325;
₆:&#8326;
₇:&#8327;
₈:&#8328;
₉:&#8329;
₊:&#8330;
₋:&#8331;
₌:&#8332;
₍:&#8333;
₎:&#8334;
ₐ:&#8336;
ₔ:&#8340;
ₑ:&#8337;
ᵢ:&#7522;
ₒ:&#8338;
ᵣ:&#7523;
ᵤ:&#7524;
ᵥ:&#7525;
ₓ:&#8339;
ᵤ:&#7524;
ᵩ:&#7529;
ᵦ:&#7526;
ₒ:&#8338;
ᵨ:&#7528;
ᵤ:&#7524;
ᵪ:&#7530;
ᵧ:&#7527;
ᴀ:&#7424;
ʙ:&#665;
ᴄ:&#7428;
ᴅ:&#7429;
ᴇ:&#7431;
ғ:&#1171;
ɢ:&#610;
ʜ:&#668;
ɪ:&#618;
ᴊ:&#7434;
ᴋ:&#7435;
ʟ:&#671;
ᴍ:&#7437;
ɴ:&#628;
ᴏ:&#7439;
ᴘ:&#7448;
ǫ:&#491;
ʀ:&#640;
s:&#115;
ᴛ:&#7451;
ᴜ:&#7452;
ᴠ:&#7456;
ᴡ:&#7457;
x:&#120;
ʏ:&#655;
ᴢ:&#7458;

相關文章