A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
14
Task/Character-codes/Metafont/character-codes.metafont
Normal file
14
Task/Character-codes/Metafont/character-codes.metafont
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
message "enter a letter: ";
|
||||
string a;
|
||||
a := readstring;
|
||||
message decimal (ASCII a); % writes the decimal number of the first character
|
||||
% of the string a
|
||||
message "enter a number: ";
|
||||
num := scantokens readstring;
|
||||
message char num; % num can be anything between 0 and 255; what will be seen
|
||||
% on output depends on the encoding used by the "terminal"; e.g.
|
||||
% any code beyond 127 when UTF-8 encoding is in use will give
|
||||
% a bad encoding; e.g. to see correctly an "è", we should write
|
||||
message char10; % (this add a newline...)
|
||||
message char hex"c3" & char hex"a8"; % since C3 A8 is the UTF-8 encoding for "è"
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue