Subversion Repositories Kolibri OS

Rev

Rev 7757 | Blame | Last modification | View Log | Download | RSS feed

  1. char *unicode_symbols[]={
  2. "quot","\"",
  3. "amp", "&",
  4. "lt",  "<",
  5. "gt",  ">",
  6. "#183","\31",   "middot", "\31",
  7. "#149","-",
  8. "#151","-",
  9. "#160"," ",     "nbsp", " ",
  10. "#169","(c)",   "copy", "(c)",
  11. "#171","<<",    "laquo","<<",
  12. "#174","(r)",   "reg",  "(r)",
  13. "#187",">>",    "raquo",">>",
  14.  
  15. "trade", "[TM]",
  16. "bdquo", ",,",
  17.  
  18. "minus", "-",
  19. "ndash", "-",
  20. "mdash", "-", //--
  21.  
  22. "rsquo", "'",
  23. "sect", "#",
  24.  
  25. "ensp",    " ",
  26. "emsp13",  " ",
  27. "emsp14",  " ",
  28. "numsp",   " ",
  29. "puncsp",  " ",
  30. "thinsp",  " ",
  31.  
  32. "#1028", "\242",
  33. "#1030", "I",
  34. "#1031", "\244",
  35.  
  36. "#8211", "-",
  37. "#8217", "'",
  38. "#8220", "\"",
  39. "#8222", "\"", "ldquo", "\"",
  40. "#8221", "\"", "rdquo", "\"",
  41. "#8470", "N",
  42. "#8722", "-",
  43. "#9642", "-", //square in the middle of the line
  44. "#9658", ">",
  45. "#9660", "v",
  46. "#65122", "+",
  47.  
  48. "uarr",  "\24",
  49. "darr",  "\25",
  50. "rarr",  "\26",
  51. "larr",  "\27",
  52.  
  53. "bull",  "\31",
  54. "percnt","%",
  55.  
  56. "#xfeff", "",
  57.  
  58. "times", "x",
  59. "lowast","*",
  60.  
  61. 0};
  62.  
  63.  
  64. unsigned char unicode_chars[] = "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯àáâãäåæçèéêëìíîïðñh£\243i\105\244\0";
  65.  
  66. bool GetUnicodeSymbol(dword _line, in_tag, size)
  67. {
  68.         int j;
  69.         int code;
  70.        
  71.         for (j=0; unicode_symbols[j]!=0; j+=2;)
  72.         {
  73.                 if (!strcmp(in_tag, unicode_symbols[j]))
  74.                 {
  75.                         strncat(_line, unicode_symbols[j+1], size);
  76.                         return true;
  77.                 }
  78.         }
  79.  
  80.         if (ESBYTE[in_tag]=='#')
  81.         {
  82.                 code = atoi(in_tag + 1);
  83.                 if (code>=0) && (code<=255)     {
  84.                         chrncat(_line, code, size); //NOT ALL ASCII CODES IN KOLIBRI ARE COMPATABLE WITH STANDARDS
  85.                         return true;
  86.                 }
  87.                 if (code>=1040) && (code<=1040+72) {
  88.                         chrncat(_line, unicode_chars[code-1040], size);
  89.                         return true;
  90.                 }
  91.         }
  92.  
  93.         return false;
  94. }
  95.