# # "ASCII extended by Latin Alphabet 1", # This charset corresponds to the ISO Latin Alphabet 1. It is an # eight-bit code", which coincides with ASCII for the lower half. # # Commented Latin-1 # # Numbers are octal, decimal and hex (in that order) # latin1vect <- c( 177,127,"7f","delete ", 200,128,"80","euro sign ", 201,129,"81","undefined ", 202,130,"82","single low-9 quote ", 203,131,"83","latin small letter f with hook ", 204,132,"84","double low-9 quote ", 205,133,"85","horizontal ellipsis ", 206,134,"86","dagger ", 207,135,"87","double dagger ", 208,136,"88","modified letter circumflex accent ", 211,137,"89","per mille or per thousand (0/00) ", 212,138,"8a","capital S hacek ", 213,139,"8b","single left-pointing angle quotation mark ", 214,140,"8c","capital diphthong O with E ", 215,141,"8d","undefined ", 216,142,"8e","capital Z hacek ", 217,143,"8f","undefined ", 220,144,"90","undefined ", 221,145,"91","upper left single quote ", 222,146,"92","upper right single quote ", 223,147,"92","upper left double quote ", 224,148,"93","upper right single quote ", 224,148,"94","upper right double quote ", 225,149,"95","bullet ", 226,150,"96","en dash ", 227,151,"97","em dash ", 230,152,"98","small tilde ", 231,153,"99","trade mark sign, ", 232,154,"9a","small s hacek ", 233,155,"9b","single right-pointing angle quotation mark", 234,156,"9c","small diphthong o with e ", 235,157,"9d","undefined ", 236,160,"9e","small z hacek ", 237,159,"9f","capital Y with diaresis ", 240,160,"a0","no-break space ", 241,161,"a1","inverted exclamation mark ", 242,162,"a2","cent sign ", 243,163,"a3","pound sign ", 244,164,"a4","currency sign ", 245,165,"a5","yen sign ", 246,166,"a6","broken bar ", 247,167,"a7","paragraph sign, section sign ", 250,168,"a8","diaeresis ", 251,169,"a9","copyright sign ", 252,170,"aa","feminine ordinal indicator ", 253,171,"ab","left angle quotation mark ", 254,172,"ac","not sign ", 255,173,"ad","soft hyphen ", 256,174,"ae","registered sign ", 257,175,"af","macron ", 260,176,"b0","degree sign ", 261,177,"b1","plus-minus sign ", 262,178,"b2","superscript two ", 263,179,"b3","superscript three ", 264,180,"b4","acute accent ", 265,181,"b5","small greek mu, micro sign ", 266,182,"b6","pilcrow sign ", 267,183,"b7","middle dot ", 270,184,"b8","cedilla ", 271,185,"b9","superscript one ", 272,186,"ba","masculine ordinal indicator ", 273,187,"bb","right angle quotation mark ", 274,188,"bc","vulgar fraction one quarter ", 275,189,"bd","vulgar fraction one half ", 276,190,"be","vulgar fraction three quarters ", 277,191,"bf","inverted question mark ", 300,192,"c0","capital A with grave accent ", 301,193,"c1","capital A with acute accent ", 302,194,"c2","capital A with circumflex accent ", 303,195,"c3","capital A with tilde ", 304,196,"c4","capital A diaeresis ", 305,197,"c5","capital A with ring above ", 306,198,"c6","capital diphthong A with E ", 307,199,"c7","capital C with cedilla ", 310,200,"c8","capital E with grave accent ", 311,201,"c9","capital E with acute accent ", 312,202,"ca","capital E with circumflex accent ", 313,203,"cb","capital E with diaeresis ", 314,204,"cc","capital I with grave accent ", 315,205,"cd","capital I with acute accent ", 316,206,"ce","capital I with circumflex accent ", 317,207,"cf","capital I with diaeresis ", 320,208,"d0","capital icelandic ETH ", 321,209,"d1","capital N with tilde ", 322,210,"d2","capital O with grave accent ", 323,211,"d3","capital O with acute accent ", 324,212,"d4","capital O with circumflex accent ", 325,213,"d5","capital O with tilde ", 326,214,"d6","capital O with diaeresis ", 327,215,"d7","multiplication sign ", 330,216,"d8","capital O with oblique stroke ", 331,217,"d9","capital U with grave accent ", 332,218,"da","capital U with acute accent ", 333,219,"db","capital U with circumflex accent ", 334,220,"dc","capital U with diaeresis ", 335,221,"dd","capital Y with acute accent ", 336,222,"de","capital icelandic THORN ", 337,223,"df","small german sharp s ", 340,224,"e0","small a with grave accent ", 341,225,"e1","small a with acute accent ", 342,226,"e2","small a with circumflex accent ", 343,227,"e3","small a with tilde ", 344,228,"e4","small a with diaeresis ", 345,229,"e5","small a with ring above ", 346,230,"e6","small diphthong a with e ", 347,231,"e7","small c with cedilla ", 350,232,"e8","small e with grave accent ", 351,233,"e9","small e with acute accent ", 352,234,"ea","small e with circumflex accent ", 353,235,"eb","small e with diaeresis ", 354,236,"ec","small i with grave accent ", 355,237,"ed","small i with acute accent ", 356,238,"ee","small i with circumflex accent ", 357,239,"ef","small i with diaeresis ", 360,240,"f0","small icelandic eth ", 361,241,"f1","small n with tilde ", 362,242,"f2","small o with grave accent ", 363,243,"f3","small o with acute accent ", 364,244,"f4","small o with circumflex accent ", 365,245,"f5","small o with tilde ", 366,246,"f6","small o with diaeresis ", 367,247,"f7","division sign ", 370,248,"f8","small o with oblique stroke ", 371,249,"f9","small u with grave accent ", 372,250,"fa","small u with acute accent ", 373,251,"fb","small u with circumflex accent ", 374,252,"fc","small u with diaresis ", 375,253,"fd","small y with acute accent ", 376,254,"fe","small icelandic thorn ", 377,255,"ff","small y with diaeresis ", ) noprintvect <- c( "000","000","00"," NUL (Fills in time) (\\0 in R)", "001","001","01","CTRL-A SOH (Start Of Header) ", "002","002","02","CTRL-B STX (Start Of text) ", "003","003","03","CTRL-C ETX (End Of Text) ", "004","004","04","CTRL-D EOT (End of Transmission) ", "005","005","05","CTRL-E ENQ (ENQuiry) ", "006","006","06","CTRL-F ACK (Receiver ACKnowledges positively) ", "007","007","07","CTRL-G BEL (Rings BELl or beeps) (\a in C) ", "010","008","08","CTRL-H BS (Move printhead Back one Space) (\b in C) ", "011","009","09","CTRL-I HT (Move to next Horizontal Tab stop) (\f in C) ", "012","010","0a","CTRL-J LF or NL (Line Feed) (\n in C) ", "013","011","0b","CTRL-K VT (Vertical Tabulation) ", "014","012","0c","CTRL-L FF or NP (Form Feed) (\f in C) ", "015","013","0d","CTRL-M CR (Carriage Return to left margin) ", "016","014","0e","CTRL-N SO (Shift Out of ASCII) ", "017","015","0f","CTRL-O SI (Shift Into ASCII) ", "020","016","10","CTRL-P DLE (Data Link Escape) ", "021","017","11","CTRL-Q DC1 (Device Control 1) ", "022","018","12","CTRL-R DC2 (Device Control 2) ", "023","019","13","CTRL-S DC3 (Device Control 3) ", "024","020","14","CTRL-T DC4 (Device Control 4) ", "025","021","15","CTRL-U NAK (Negative AcKnowledgement) ", "025","022","16","CTRL-V SYN (Send in place of data to synchonize) ", "027","023","17","CTRL-W ETB (End of Transmission Block) ", "030","024","18","CTRL-X CAN (CANcel previous data) ", "031","025","19","CTRL-Y EM (End of Medium) ", "032","026","1a","CTRL-Z SUB (Substitute) ", "033","027","1b","CTRL-[ ESC (ESCape to extended character set) ", "034","028","1c","CTRL-\\ FS (File Separator) ", "035","029","1d","CTRL-] GS (Group Separator) ", "036","030","1e","CTRL-^ RS (Record separator) ", "037","030","1f","CTRL-_ US (Unit separator) ", "040","031","20"," SP (Non-breaking blank SPace character) " ) latin1matrix <- matrix(latin1vect,length(latin1vect)/4,4,byrow=T) noprintmatrix <- matrix(noprintvect,length(noprintvect)/4,4,byrow=T) colnames(latin1matrix) <- c("oct","dec","hex", "description (latin1 from 240 to 377)") .tmp00. <-"\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017" .tmp01. <-"\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" .tmp02. <-"\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057" .tmp03. <-"\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077" .tmp04. <-"\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117" .tmp05. <-"\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137" .tmp06. <-"\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157" .tmp07. <-"\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177" .tmp0. <- paste(.tmp00.,.tmp01.,.tmp02.,.tmp03.,.tmp04.,.tmp05.,.tmp06.,.tmp07.,sep="") .tmp10. <-"\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217" .tmp11. <-"\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237" .tmp12. <-"\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257" .tmp13. <-"\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277" .tmp14. <-"\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317" .tmp15. <-"\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337" .tmp16. <-"\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357" .tmp17. <-"\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377" .tmp1. <- paste(.tmp10.,.tmp11.,.tmp12.,.tmp13.,.tmp14.,.tmp15.,.tmp16.,.tmp17.,sep="") .tmp. <- paste(.tmp0.,.tmp1.,sep="") latin1 <- rep("",255) for (i in 1:nchar(.tmp.)) latin1[i+15] <- substr(.tmp.,i,i) remove(.tmp00.,.tmp01.,.tmp02.,.tmp03.,.tmp04.,.tmp05.,.tmp06.,.tmp07.,.tmp0.) remove(.tmp10.,.tmp11.,.tmp12.,.tmp13.,.tmp14.,.tmp15.,.tmp16.,.tmp17.,.tmp1.,.tmp.) hex.value <- function(s) { switch(s,"0"=0,"1"=1,"2"=2,"3"=3,"4"=4,"5"=5,"6"=6,"7"=7, "8"=8,"9"=9,"a"=10,"b"=11,"c"=12,"d"=13,"e"=14,"f"=15)} value.hex <- function(n){ switch(n+1,"0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f")} decimal.to.octal <- function(n){ 100*n%/%8%/%8 + 10*n%/%8%%8 + n%%8%%8 } decimal.to.hex <- function(n){paste(value.hex(n%/%16),value.hex(n%%16),sep="")} octal.to.decimal <- function(n){ 64*n%/%10%/%10 + 8*n%/%10%%10 + n%%10%%10 } octal.to.hex <- function(n) decimal.to.hex(octal.to.decimal(n)) hex.to.decimal <- function(s){ 16*hex.value(substr(s,1,1))+hex.value(substr(s,2,2))} hex.to.octal <- function(s) decimal.to.octal(hex.to.decimal(s)) cat("For list of characters, use print(latin1matrix,quote=F); \n") cat("for printing characters, use print(latin1,quote=F); \n") cat("for non-printing characters, use print(noprintmatrix,quote=F); \n") cat("for character with decimal number n, use print(latin1[n]); \n") cat("for character with octal number m, use print(\"\\m\"). \n") cat("Functions octal.to.decimal, decimal.to.octal, decimal.to.hex, \n") cat("hex.to.decimal, octal.to.hex and hex.to.octal are provided \n") cat("(valid for numbers less than 512 decimal = 1000 octal or for \n") cat("hex conversions less than 256 decimal = 400 octal = \"100\" hex). \n") cat("Symbols employed are latin1 with CP1252. \n")