📄 ckcuni.c
字号:
char * ckcuni = "Unicode support 7.0.107, 1 Jan 2000";#ifdef OS2#define KERMITFONT#endif /* OS2 *//* C K C U N I . C -- Unicode/Terminal character-set translations *//* Copyright (C) 1999, 2000, Trustees of Columbia University in the City of New York. All rights reserved. See the C-Kermit COPYING.TXT file or the copyright text in the ckcmai.c module for disclaimer and permissions. Authors: Frank da Cruz <fdc@columbia.edu> Jeffrey Altman <jaltman@columbia.edu> The Kermit Project, Columbia University, New York City. Functions u_blah() translate from blah to Unicode (incoming material). Functions tx_blah() translate from Unicode to blah (keystrokes). Function pointers are kept in parallel arrays indexed by TX_blah values defined in ckcuni.h. NOTE: tx_decspec and tx_dectech are undefined since these character sets are never typed, only displayed. The blah_u() routines accept an unsigned character value in character-set blah, and return the Unicode translation, or 0xfffd if the character is not defined in Unicode. The 8th bit of the argument should be ignored, a`la ISO 4873 and 2022. The tx_blah() routines accept a unicode value and return the value of the corresponding character in character-set blah, or else -1 if the character does not exist in blah. In this case, the full 8-bit value is returned, since ISO 2022 only works in the host-to-terminal direction. NOTE: KERMITFONT should be defined only if we are using the new (still hypothetical) Kermit font that has all the VT/Heath/Wyse/TVI graphic characters in it. IMPORTANT: all Kermitfont code points need updating to the values in the final proposal to the UTC. TO DO: A lot of the functions can be tightened up -- use ranges when possible, sort switch statements in order of frequency, etc.*/#include "ckcsym.h" /* Includes... */#include "ckcdeb.h"#include "ckcker.h"#include "ckucmd.h"#include "ckcxla.h"#include "ckuxla.h"#ifdef UNICODE#ifdef OS2/* This material is needed for the integration of TextPS into Kermit 95. When printing a file we use the SET FILE CHARACTER-SET value as the input character-set and then convert it to the special Latin1 set called CourierLatin1 using the Unicode translation functions.*/struct _pair { int tx; int fc; } TXFC[] = { TX_ASCII, FC_USASCII, TX_BRITISH, FC_UKASCII, TX_CN_FRENCH, FC_FCASCII, TX_CP437, FC_CP437, TX_CP850, FC_CP850, TX_CP852, FC_CP852, TX_CP857, -2, TX_CP862, FC_CP862, TX_CP864, -2, TX_CP866, FC_CP866, TX_CP869, -2, TX_CUBAN, -2, TX_CZECH, -2, TX_DANISH, -2, TX_DECMCS, FC_DECMCS, TX_DECSPEC, -2, /* while defined, not in fcs tables */ TX_DECTECH, -2, /* while defined, not in fcs tables */ TX_DGI, FC_DGMCS, TX_DUTCH, FC_DUASCII, TX_FINNISH, FC_FIASCII, TX_FRENCH, FC_FRASCII, TX_GERMAN, FC_GEASCII, TX_HE7, FC_HE7, TX_HPR8, FC_HPR8, TX_HUNGARIAN, FC_HUASCII, TX_ITALIAN, FC_ITASCII, TX_J201R, -2, TX_J201K, -2, TX_KOI7, FC_KOI7, TX_KOI8, FC_KOI8, TX_KOI8R, FC_KOI8R, TX_KOI8U, FC_KOI8U, TX_8859_1, FC_1LATIN, TX_8859_2, FC_2LATIN, TX_8859_3, -2, TX_8859_4, -2, TX_8859_5, FC_CYRILL, TX_8859_6, -2, TX_8859_7, -2, TX_8859_8, FC_HEBREW, TX_8859_9, -2, TX_8859_10, -2, TX_8859_15, -2, TX_MACL1, FC_APPQD, TX_NEXT, FC_NEXT, TX_NORWEGIAN, FC_NOASCII, TX_PORTUGUESE, FC_POASCII, TX_SPANISH, FC_SPASCII, TX_SWEDISH, FC_SWASCII, TX_SWISS, FC_CHASCII, TX_ICELANDIC, -2, TX_JIS7, -2, TX_SHJIS, FC_SHJIS, TX_JEUC, FC_JEUC, TX_JDEC, FC_JDEC, TX_ELOT927, FC_ELOT, TX_DGPCGRPH, -2, TX_DGLDGRPH, -2, TX_DGWPGRPH, -2, TX_HPLINE, -2, TX_HPMATH, -2, TX_QNXGRPH, -2, TX_SNIBRACK, -2, TX_SNIEURO, -2, TX_SNIFACET, -2, TX_SNIIBM, -2, TX_SNIBLANK, -2, TX_CP1252, -2, TX_CP1250, FC_CP1250, TX_CP1251, FC_CP1251, TX_CP1253, -2, TX_CP1254, -2, TX_CP1257, -2, TX_CP856, -2, TX_CP855, FC_CP855, TX_CP819, FC_1LATIN, TX_CP912, FC_2LATIN, TX_CP913, -2, TX_CP914, -2, TX_CP915, FC_CYRILL, TX_CP1089, -2, TX_CP813, FC_GREEK, TX_CP916, FC_HEBREW, TX_CP920, -2, TX_CP1051, -2, TX_CP858, FC_CP858, TX_8859_15, FC_9LATIN, TX_CP923, FC_CP923, TX_ELOT928, -2, TX_CP10000, -2, TX_CP37, -2, TX_CP1255, -2, TX_CP1256, -2, TX_CP1258, -2, TX_MAZOVIA, FC_MAZOVIA, TX_TRANSP, FC_TRANSP};int nTXFC = sizeof(TXFC) / sizeof(struct _pair);int#ifdef CK_ANSICfc2tx(int fc)#elsefc2tx(int c) int fc;#endif /* CK_ANSIC */{ int i; for (i = 0; i<nTXFC ; i++) if (TXFC[i].fc == fc && TXFC[i].tx >= 0) return(TXFC[i].tx); return(TX_ASCII);}int#ifdef CK_ANSICtx2fc(int tx)#elsetx2fc(int x) int tx;#endif /* CK_ANSIC */{ int i; for (i = 0; i < nTXFC ; i++) if (TXFC[i].tx == tx && TXFC[i].fc >= 0) return(TXFC[i].fc); return(FC_USASCII);}/* SET TERMINAL REMOTE CHARACTER-SET keyword table */struct keytab txrtab[] = { "arabic-iso", TX_8859_6, 0, "ascii", TX_ASCII, 0, "british", TX_BRITISH, 0, "canadian-french", TX_CN_FRENCH, 0, "bulgaria-pc", TX_CP856, 0,#ifdef COMMENT "cp037", TX_CP37, 0, /* U.S. EBCDIC */#endif /* COMMENT */ "cp10000", TX_CP10000, 0, /* Apple Quickdraw */ "cp1051", TX_CP1051, 0, /* Same as HP Roman 8 */ "cp1089", TX_CP1089, 0, /* Same as ISO 8859-6 */ "cp1250", TX_CP1250, 0, /* Latin-2 Windows */ "cp1251", TX_CP1251, 0, /* Cyrillic Windows */ "cp1252", TX_CP1252, 0, /* Latin-1 Windows */ "cp1253", TX_CP1253, 0, /* Greek Windows */ "cp1254", TX_CP1254, 0, /* Turkey Windows */ "cp1255", TX_CP1255, 0, /* Hebrew Windows */ "cp1256", TX_CP1256, 0, /* Arabic Windows */ "cp1257", TX_CP1257, 0, /* Latin-4 Windows */ "cp1258", TX_CP1258, 0, /* Viet Nam Windows */ "cp437", TX_CP437, 0, "cp813", TX_CP813, 0, /* Same as ISO 8859-7 */ "cp819", TX_CP819, 0, /* Same as ISO 8859-1 */ "cp850", TX_CP850, 0, "cp852", TX_CP852, 0, "cp855", TX_CP855, 0, /* Cyrillic */ "cp856", TX_CP856, CM_INV, /* Bulgaria */ "cp857", TX_CP857, 0, /* Latin-5 */ "cp858", TX_CP858, 0, /* Euro modified cp850 */ "cp862-hebrew", TX_CP862, 0, /* Hebrew */ "cp864", TX_CP864, 0, /* Arabic */ "cp866", TX_CP866, 0, /* Cyrillic */ "cp869", TX_CP869, 0, /* Greek */ "cp912", TX_CP912, 0, /* Same as ISO 8859-2 */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -