Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 May 1998 17:27:14 +0300 (EEST)
From:      Sergey Shkonda <serg@bcs.zp.ua>
To:        freebsd-mozilla@FreeBSD.ORG
Subject:   Cyrrilic support
Message-ID:  <199805171427.RAA28932@bcs3.bcs.zaporizhzhe.ua>

next in thread | raw e-mail | index | archive | help
Thist patch allow displaying CP_1251 charset
via KOI8-R fonts


*** lib/libi18n/fe_ccc.c.orig	Fri May 15 20:25:00 1998
--- lib/libi18n/fe_ccc.c	Fri May 15 20:26:41 1998
***************
*** 436,441 ****
--- 436,445 ----
  		/* CYRILLIC */
  		{CS_KOI8_R,		CS_KOI8_R,		0, NULL,			0},	
  		{CS_8859_5,		CS_8859_5,		0, NULL,			0},	
+ 
+ 		{CS_CP_1251,		CS_KOI8_R,		0, (CCCFunc)One2OneCCC, 0},	
+ 		{CS_KOI8_R,		CS_CP_1251,		0, (CCCFunc)One2OneCCC, 0},	
+ 
  		{CS_8859_5,		CS_KOI8_R,		0, (CCCFunc)One2OneCCC, 0},	
  		{CS_KOI8_R,		CS_8859_5,		0, (CCCFunc)One2OneCCC, 0},	
  		{CS_CP_1251,	CS_8859_5,		0, (CCCFunc)One2OneCCC, 0},	
*** lib/libi18n/sbconvtb.c.orig	Fri May 15 20:23:45 1998
--- lib/libi18n/sbconvtb.c	Fri May 15 20:42:41 1998
***************
*** 110,115 ****
--- 110,143 ----
  };
  PRIVATE char *koi8r_to_iso8859_5_p = (char*)koi8r_to_iso8859_5;
  
+ /*  Translation koi8r -> cp1251
+  */
+ PRIVATE unsigned char koi8r_to_cp1251[] = {
+ /*8x*/  '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?',
+ /*9x*/  '?', '?', '?', '?', '?', '?', '?', '?', '?', '?',0xA0, '?', '?', '?', '?', '?',
+ /*Ax*/ 0x87,0x92,0xAD,0xB8,0xBA,0xA1,0xB3,0xBF,0x93,0xAC,0xAB,0xA0,0x96,0xB4,0x94,0x9E,
+ /*Bx*/ 0x9F,0xA4,0x8D,0xA8,0xAA,0x91,0xB2,0xAF,0xA3,0xA7,0x82,0xA2,0xB0,0xA5,0xA6,0xBC,
+ /*Cx*/ 0xFE,0xE0,0xE1,0xF6,0xE4,0xE5,0xF4,0xE3,0xF5,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,
+ /*Dx*/ 0xEF,0xFF,0xF0,0xF1,0xF2,0xF3,0xE6,0xE2,0xFC,0xFB,0xE7,0xF8,0xFD,0xF9,0xF7,0xFA,
+ /*Ex*/ 0xDE,0xC0,0xC1,0xD6,0xC4,0xC5,0xD4,0xC3,0xD5,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,
+ /*Fx*/ 0xCF,0xDF,0xD0,0xD1,0xD2,0xD3,0xC6,0xC2,0xDC,0xDB,0xC7,0xD8,0xDD,0xD9,0xD7,0xDA,
+ };
+ PRIVATE char *koi8r_to_cp1251_p = (char*)koi8r_to_cp1251;
+ 
+ /*  Translation koi8r -> cp1251
+  */
+ PRIVATE unsigned char cp1251_to_koi8r[] = {
+ /*8x*/  '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?',
+ /*9x*/  '?', '?', '?', '?', '?', '?', '?', '?', '?', '?',0xA0, '?', '?', '?', '?', '?',
+ /*Ax*/ 0xAB,0xA5,0xBB,0xB8,0xB1,0xBD,0xBE,0xB9,0xB3,0x93,0xB4,0xAA,0xA9,0xA2,0x95,0xB7,
+ /*Bx*/ 0xBC,0x85,0xB6,0xA6,0xAD,0x8E,0x8F,0x8B,0xA3,0x9A,0xA4,0x96,0xBF,0x9D,0x94,0xA7,
+ /*Cx*/ 0xE1,0xE2,0xF7,0xE7,0xE4,0xE5,0xF6,0xFA,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,
+ /*Dx*/ 0xF2,0xF3,0xF4,0xF5,0xE6,0xE8,0xE3,0xFE,0xFB,0xFD,0xFF,0xF9,0xF8,0xFC,0xE0,0xF1,
+ /*Ex*/ 0xC1,0xC2,0xD7,0xC7,0xC4,0xC5,0xD6,0xDA,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,
+ /*Fx*/ 0xD2,0xD3,0xD4,0xD5,0xC6,0xC8,0xC3,0xDE,0xDB,0xDD,0xDF,0xD9,0xD8,0xDC,0xC0,0xD1,
+ };
+ PRIVATE char *cp1251_to_koi8r_p = (char*)cp1251_to_koi8r;
+ 
  /*  Translation cp1250 -> 8859-2 
   * There are 32 characters unmapped:
   * 80 - 89, 8B, 90 - 99, 9B, A6, A9, AB, AC, AE, B1, B5, B6, B7, BB
***************
*** 223,228 ****
--- 251,262 ----
  	}
  
  	/* CYRILLIC */
+ 	else if ((from_csid == CS_CP_1251) && (to_csid == CS_KOI8_R)) {
+ 		return &cp1251_to_koi8r_p;
+ 	}
+ 	else if ((from_csid == CS_KOI8_R) && (to_csid == CS_CP_1251)) {
+ 		return &koi8r_to_cp1251_p;
+ 	}
  	else if ((from_csid == CS_8859_5) && (to_csid == CS_KOI8_R)) {
  		return &iso8859_5_to_koi8r_p;
  	}


--
Sergey Shkonda           (serg@bcs.zaporizhzhe.ua)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-mozilla" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199805171427.RAA28932>