144 lines
4.2 KiB
C#
144 lines
4.2 KiB
C#
public class Image {
|
|
public static string image(char ch) {
|
|
switch (ch) {
|
|
default:
|
|
return "<UNICODE>";
|
|
case '\u0000': return "\\u0000";
|
|
case '\u0001': return "\\u0001";
|
|
case '\u0002': return "\\u0002";
|
|
case '\u0003': return "\\u0003";
|
|
case '\u0004': return "\\u0004";
|
|
case '\u0005': return "\\u0005";
|
|
case '\u0006': return "\\u0006";
|
|
case '\u0007': return "\\u0007";
|
|
case '\u0008': return "\\b";
|
|
case '\u0009': return "\\t";
|
|
case '\u000a': return "\\n";
|
|
case '\u000b': return "\\v";
|
|
case '\u000c': return "\\f";
|
|
case '\u000d': return "\\r";
|
|
case '\u000e': return "\\u000e";
|
|
case '\u000f': return "\\u000f";
|
|
case '\u0010': return "\\u0010";
|
|
case '\u0011': return "\\u0011";
|
|
case '\u0012': return "\\u0012";
|
|
case '\u0013': return "\\u0013";
|
|
case '\u0014': return "\\u0014";
|
|
case '\u0015': return "\\u0015";
|
|
case '\u0016': return "\\u0016";
|
|
case '\u0017': return "\\u0017";
|
|
case '\u0018': return "\\u0018";
|
|
case '\u0019': return "\\u0019";
|
|
case '\u001a': return "\\u001a";
|
|
case '\u001b': return "\\u001b";
|
|
case '\u001c': return "\\u001c";
|
|
case '\u001d': return "\\u001d";
|
|
case '\u001e': return "\\u001e";
|
|
case '\u001f': return "\\u001f";
|
|
case '\u0020': return " ";
|
|
case '\u0021': return "!";
|
|
case '\u0022': return "\\\"";
|
|
case '\u0023': return "#";
|
|
case '\u0024': return "$";
|
|
case '\u0025': return "%";
|
|
case '\u0026': return "&";
|
|
case '\x27': return "'";
|
|
case '\u0028': return "(";
|
|
case '\u0029': return ")";
|
|
case '\u002a': return "*";
|
|
case '\u002b': return "+";
|
|
case '\u002c': return ",";
|
|
case '\u002d': return "-";
|
|
case '\u002e': return ".";
|
|
case '\u002f': return "/";
|
|
case '\u0030': return "0";
|
|
case '\u0031': return "1";
|
|
case '\u0032': return "2";
|
|
case '\u0033': return "3";
|
|
case '\u0034': return "4";
|
|
case '\u0035': return "5";
|
|
case '\u0036': return "6";
|
|
case '\u0037': return "7";
|
|
case '\u0038': return "8";
|
|
case '\u0039': return "9";
|
|
case '\u003a': return ":";
|
|
case '\u003b': return ";";
|
|
case '\u003c': return "<";
|
|
case '\u003d': return "=";
|
|
case '\u003e': return ">";
|
|
case '\u003f': return "?";
|
|
case '\u0040': return "@";
|
|
case '\u0041': return "A";
|
|
case '\u0042': return "B";
|
|
case '\u0043': return "C";
|
|
case '\u0044': return "D";
|
|
case '\u0045': return "E";
|
|
case '\u0046': return "F";
|
|
case '\u0047': return "G";
|
|
case '\u0048': return "H";
|
|
case '\u0049': return "I";
|
|
case '\u004a': return "J";
|
|
case '\u004b': return "K";
|
|
case '\u004c': return "L";
|
|
case '\u004d': return "M";
|
|
case '\u004e': return "N";
|
|
case '\u004f': return "O";
|
|
case '\u0050': return "P";
|
|
case '\u0051': return "Q";
|
|
case '\u0052': return "R";
|
|
case '\u0053': return "S";
|
|
case '\u0054': return "T";
|
|
case '\u0055': return "U";
|
|
case '\u0056': return "V";
|
|
case '\u0057': return "W";
|
|
case '\u0058': return "X";
|
|
case '\u0059': return "Y";
|
|
case '\u005a': return "Z";
|
|
case '\u005b': return "[";
|
|
case '\x5c': return "\\\\";
|
|
case '\u005d': return "]";
|
|
case '\u005e': return "^";
|
|
case '\u005f': return "_";
|
|
case '\u0060': return "`";
|
|
case '\u0061': return "a";
|
|
case '\u0062': return "b";
|
|
case '\u0063': return "c";
|
|
case '\u0064': return "d";
|
|
case '\u0065': return "e";
|
|
case '\u0066': return "f";
|
|
case '\u0067': return "g";
|
|
case '\u0068': return "h";
|
|
case '\u0069': return "i";
|
|
case '\u006a': return "j";
|
|
case '\u006b': return "k";
|
|
case '\u006c': return "l";
|
|
case '\u006d': return "m";
|
|
case '\u006e': return "n";
|
|
case '\u006f': return "o";
|
|
case '\u0070': return "p";
|
|
case '\u0071': return "q";
|
|
case '\u0072': return "r";
|
|
case '\u0073': return "s";
|
|
case '\u0074': return "t";
|
|
case '\u0075': return "u";
|
|
case '\u0076': return "v";
|
|
case '\u0077': return "w";
|
|
case '\u0078': return "x";
|
|
case '\u0079': return "y";
|
|
case '\u007a': return "z";
|
|
case '\u007b': return "{";
|
|
case '\u007c': return "|";
|
|
case '\u007d': return "}";
|
|
case '\u007e': return "~";
|
|
} // switch
|
|
} // public string image
|
|
public static string image(string str) {
|
|
string s = "\"";
|
|
for(int i = 0; i < str.Length; i++) {
|
|
s += image(str[i]);
|
|
}
|
|
s += "\"";
|
|
return s;
|
|
} // public string image
|
|
} // public class Image
|