Ocenite etot tekst:


From: Ales Popov 

 NM)                      libc-5.2.18, ld.so-1.7.14...
Vot v etoj biblioteke delo ^^^^^^^^^^  !
Mozhno prosto vzyat' ee s CD Linux.Yes ili peresobrat' etu biblioteku.
Tol'ko nado v syrcah ispravit', - eto vot s togo sidyuka:

=== Begin 11.r ===
Eugene Shakhtarin 

Lokalizaciya koi8-r dlya versii libc 5.2.18 (ELF).
Sdelano v Linux kernel 1.3.57, gcc 2.7.2.

 1) Opisanie mehanizma generacii locale nahoditsya zdes':
http://es-sun2.fernuni-hagen.de/public/mirrors/GCC-experimental/Intro

2) Standarty charmap i locale nahodyatsya zdes':
http://www.dkuug.dk/JTC1/SC22/WG15/

3) V distributive libc 5.2.18 funkciya libc/locale/ctype.c neispravna,
 a imenno, v operatore (is_upper ? toupper_done : tolower_done)
|=  BIT  (token);  vyrazhenie  BIT  (token)   ravno   0   vmesto
neobhodimoj  1  i  tolower_done poluchaet znachenie 0, dazhe kogda
tolower tablica sformirovana. ctype.c dalee  prinimaet  reshenie
zamenit' tolower na umolchanie.

 Dlya pochinki trebuetsya zamena v libc/locale/ctype.c:
/*
static unsigned short toupper_done = 0;
static unsigned short tolower_done = 0;
 */
static unsigned toupper_done = 0;
static unsigned tolower_done = 0;

Vot sootvetstvuyushchij patch:
*** ctype.c.orig        Tue Jan 16 19:02:43 1996
--- ctype.c     Tue Jan 16 19:03:23 1996
***************
*** 54,59 ****
--- 54,63 ----
  /* Remember which class or conversion is already done.  */
  static unsigned short class_done = 0;
+ /*
  static unsigned short toupper_done = 0;
  static unsigned short tolower_done = 0;
+  */
+ static unsigned toupper_done = 0;
+ static unsigned tolower_done = 0;

  #define SYNTAX_ERROR \

Zdes' nahodyatsya
http://eugene.mplik.ru/pub/Linux/utils/nls/locale/libc-5.2.18.fix/
ctype.c -- 6534 ispravlennyj variant ctype.c
localedef.gz -- 53833 programma, ottranslirovannaya dlya otladchika s klyuchem -g

4) Translyaciya localedef.c (i locale.c):
make SHARED= programs

5) V libc 5.2.18 podderzhka LC_COLLATE ne realizovana voobshche.

6)  Dlya  generacii  bazy dannyh locale dlya koi8-r v depozitarii
net gotovyh ishodnyh dannyh.
 http://www.dkuug.dk/JTC1/SC22/WG15/
Ishodnye dannye dlya generacii koi8-r nahodyatsya zdes':
 http://eugene.mplik.ru/pub/Linux/utils/nls/locale/share/nls/charmap/KOI8-R
 http://eugene.mplik.ru/pub/Linux/utils/nls/locale/share/nls/locale/ru_RU

|ti dannye podgotovleny na osnove standartov ISO 10646 (Unicode),
RFC-1489 i depozitariya
http://www.dkuug.dk/JTC1/SC22/WG15/

Fajly  KOI8-R i ru_RU ne yavlyayutsya oficial'nymi dokumentami i ne
obladayut nikakim formal'nym statusom. Oni sdelany  dlya  lichnogo
upotrebleniya, ne imeyut ogranichenij na tirazhirovanie, i garantiya
ih prigodnosti  dlya  kakih-libo  opredelennyh  celej  absolyutno
otsutstvuet.

7) Generaciya bazy dannyh locale dlya koi8-r.
7.1) Sozdat' katalogi
mkdirhier /usr/share/nls/charmap
mkdir /usr/share/nls/locale
mkdir /usr/share/locale

7.1) Razmestit' opisaniya KOI8-R i ru_RU v katalogah
/usr/share/nls/charmap/KOI8-R
/usr/share/nls/locale/ru_RU

7.2) Postroit' opisanie kategorij koi8-r v kataloge /usr/share/locale/koi8-r/
localedef -c -i /usr/share/nls/locale/ru_RU -f KOI8-R koi8-r

 Uzhe   gotovyj  nabor  opisanij  kategorij  koi8-r,  poluchennyj
opisannym metodom, nahoditsya v
 http://eugene.mplik.ru/pub/Linux/utils/nls/locale/share/locale/koi8-r/

8) Ispol'zovanie postroennoj lokalizacii koi8-r.
8.1) Opredelit' peremennuyu komandnoj sredy
export LANG=koi8-r

Posle etogo programmy, sozdannye na baze libc 5.2.18 s uchetom locale,
budut lokalizovany sootvetstvuyushchim obrazom.

8.2) Dlya internacionalizacii sozdavaemoj programmy neobhodimo primenit'
funkciyu setlocale (sm. man setlocale), naprimer:
#include 
#include 
main()
{
int c, C;
setlocale(LC_ALL, "");

c='j';
C=toupper(c);
printf("%c\n", C);

C='J';
c=tolower(C);
printf("%c\n", c);

}

Last-modified: Sun, 18 Aug 1996 16:43:32 GMT
Ocenite etot tekst: