1 --- gettext-0.10.35/src/msgmerge.c.orig Mon Feb 12 19:38:15 2001
2 +++ gettext-0.10.35/src/msgmerge.c Mon Feb 12 19:40:46 2001
5 #define _(str) gettext (str)
7 +extern void setmblocale(char* filename);
9 /* This structure defines a derived class of the po_ty class. (See
10 po.h for an explanation.) */
13 /* merge the two files */
14 result = merge (argv[optind], argv[optind + 1]);
16 + /* multibyte handling */
17 + setmblocale(argv[optind]);
19 /* Sort the results. */
21 --- gettext-0.10.35/src/message.c.oka Mon Feb 12 20:13:59 2001
22 +++ gettext-0.10.35/src/message.c Mon Feb 12 20:15:15 2001
24 static const char *make_c_width_description_string PARAMS ((enum is_c_format));
25 static int significant_c_format_p PARAMS ((enum is_c_format __is_c_format));
27 +static int mblocale_flag = 0; /* OFF */
29 +void setmblocale(char* filename) {
33 + static const char* contstr =
34 + "\"Content-Type: text/plain; charset=";
36 + static const char *mblocale[] =
42 + if ( filename == NULL || *filename == '\0' )
45 + if ( (fp = fopen(filename, "r")) == NULL )
48 + while( fgets(tmpbuf, sizeof(tmpbuf), fp) > 0 ) {
49 + if( !strcmp(tmpbuf, "\n") )
52 + if( !strncmp(tmpbuf, contstr, strlen(contstr)) ) {
53 + if( strlen(tmpbuf) > strlen(contstr) ) {
54 + for(i=0; i<sizeof(mblocale)/sizeof(mblocale[0]); i++) {
55 + if( !strncasecmp(tmpbuf + strlen(contstr),
56 + mblocale[i], strlen(mblocale[i])) ) {
67 +static int ismblocale() {
68 + return mblocale_flag;
74 /* Allow 1 character for the closing quote. */
75 if (ocol + cw >= (do_wrap == no ? INT_MAX : page_width))
77 + else if (ismblocale() && c >= 0xa1 && c <= 0xfe) { /* UJIS */
80 + c = (unsigned char) *ep;
81 + if (ocol + cw >= (do_wrap == no ? INT_MAX : page_width - 1 )) {
92 for (bp = ep; bp > s; --bp)
93 - if (bp[-1] == ' ' || bp[-1] == '\n')
94 + if (bp[-1] == ' ' || bp[-1] == '\n' ||
95 + (ismblocale() && bp[-1] >= 0xa1 && bp[-1] <= 0xfe) ) /* UJIS */