[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/makeinfo html.c,1.13,1.14 lang.c,1.8,1.9 lang.h,1.3,1.4
From: |
dirt |
Subject: |
texinfo/makeinfo html.c,1.13,1.14 lang.c,1.8,1.9 lang.h,1.3,1.4 |
Date: |
Sat, 28 Feb 2004 13:46:53 +0100 |
Update of /cvsroot/texinfo/texinfo/makeinfo
In directory sheep:/tmp/cvs-serv280/makeinfo
Modified Files:
html.c lang.c lang.h
Log Message:
2004-02-28 Alper Ersoy <address@hidden>
* makeinfo/lang.h: new variable unknown_encoding.
* makeinfo/lang.c (cm_documentencoding): save and use the encoding
argument even if it's unknown.
* makeingo/html.c (html_output_head): call current_document_encoding
instead of checking document_encoding_code.
Index: html.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/html.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** html.c 17 Feb 2004 14:58:59 -0000 1.13
--- html.c 28 Feb 2004 12:46:50 -0000 1.14
***************
*** 194,197 ****
--- 194,198 ----
{
static const char *html_title = NULL;
+ char *encoding;
if (html_output_head_p)
***************
*** 199,202 ****
--- 200,205 ----
html_output_head_p = 1;
+ encoding = current_document_encoding ();
+
/* The <title> should not have markup, so use text_expansion. */
if (!html_title)
***************
*** 219,225 ****
add_word ("<meta http-equiv=\"Content-Type\" content=\"text/html");
! if (document_encoding_code != no_encoding)
! add_word_args ("; charset=%s",
! encoding_table[document_encoding_code].encname);
add_word ("\">\n");
--- 222,228 ----
add_word ("<meta http-equiv=\"Content-Type\" content=\"text/html");
! if (encoding && *encoding)
! add_word_args ("; charset=%s", encoding);
!
add_word ("\">\n");
***************
*** 326,329 ****
--- 329,334 ----
html_title_written = 1;
}
+
+ free (encoding);
}
Index: lang.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/lang.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** lang.c 13 Feb 2004 22:01:38 -0000 1.8
--- lang.c 28 Feb 2004 12:46:51 -0000 1.9
***************
*** 33,36 ****
--- 33,39 ----
language_code_type language_code = en;
+ /* By default, unsupported encoding is an empty string. */
+ char *unknown_encoding = NULL;
+
static iso_map_type us_ascii_map [] = {{NULL, 0, 0}}; /* ASCII map is trivial
*/
***************
*** 528,532 ****
/* If we didn't find this code, complain. */
if (enc == last_encoding_code)
! warning (_("unrecognized encoding name `%s'"), enc_arg);
else if (encoding_table[document_encoding_code].isotab == NULL)
--- 531,541 ----
/* If we didn't find this code, complain. */
if (enc == last_encoding_code)
! {
! warning (_("unrecognized encoding name `%s'"), enc_arg);
! /* Let the previous one go. */
! if (unknown_encoding && *unknown_encoding)
! free (unknown_encoding);
! unknown_encoding = xstrdup (enc_arg);
! }
else if (encoding_table[document_encoding_code].isotab == NULL)
***************
*** 535,543 ****
free (enc_arg);
}
! else if (xml && document_encoding_code != no_encoding)
{
! insert_string (" encoding=\"");
! insert_string (current_document_encoding ());
! insert_string ("\"");
}
}
--- 544,559 ----
free (enc_arg);
}
! else if (xml)
{
! char *encoding = current_document_encoding ();
!
! if (encoding && *encoding)
! {
! insert_string (" encoding=\"");
! insert_string (encoding);
! insert_string ("\"");
! }
!
! free (encoding);
}
}
***************
*** 546,550 ****
current_document_encoding (void)
{
! return xstrdup (encoding_table[document_encoding_code].encname);
}
--- 562,571 ----
current_document_encoding (void)
{
! if (document_encoding_code != no_encoding)
! return xstrdup (encoding_table[document_encoding_code].encname);
! else if (unknown_encoding && *unknown_encoding)
! return xstrdup (unknown_encoding);
! else
! return xstrdup ("");
}
Index: lang.h
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/lang.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** lang.h 13 Feb 2004 22:01:38 -0000 1.3
--- lang.h 28 Feb 2004 12:46:51 -0000 1.4
***************
*** 101,104 ****
--- 101,106 ----
extern encoding_code_type document_encoding_code;
+ /* If an encoding is not supported, just keep it as a string. */
+ extern char *unknown_encoding;
/* Maps an HTML abbreviation to ISO and Unicode codes for a given code. */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- texinfo/makeinfo html.c,1.13,1.14 lang.c,1.8,1.9 lang.h,1.3,1.4,
dirt <=