diff mbox series

fwts_log_html: move fwts_log_html_ascii_table into fwts_log_html_convert_ascii

Message ID 20210411133926.1202742-1-colin.king@canonical.com
State Accepted
Headers show
Series fwts_log_html: move fwts_log_html_ascii_table into fwts_log_html_convert_ascii | expand

Commit Message

Colin Ian King April 11, 2021, 1:39 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The scope of array fwts_log_html_ascii_table is limited to just
function fwts_log_html_convert_ascii so move it into the function.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/lib/src/fwts_log_html.c | 244 ++++++++++++++++++------------------
 1 file changed, 122 insertions(+), 122 deletions(-)

Comments

Alex Hung April 11, 2021, 8:54 p.m. UTC | #1
On 2021-04-11 7:39 a.m., Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The scope of array fwts_log_html_ascii_table is limited to just
> function fwts_log_html_convert_ascii so move it into the function.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/lib/src/fwts_log_html.c | 244 ++++++++++++++++++------------------
>  1 file changed, 122 insertions(+), 122 deletions(-)
> 
> diff --git a/src/lib/src/fwts_log_html.c b/src/lib/src/fwts_log_html.c
> index 4397a3f1..eca8e666 100644
> --- a/src/lib/src/fwts_log_html.c
> +++ b/src/lib/src/fwts_log_html.c
> @@ -39,128 +39,6 @@ typedef struct {
>  	char *		html;	/* HTML equivalent */
>  } fwts_log_html_ascii_t;
>  
> -/*
> - * ASCII to HTML conversion table:
> - * ISO 10646, ISO 8879, ISO 8859-1 Latin alphabet No. 1
> - * Browser support: All browsers
> - */
> -static const fwts_log_html_ascii_t fwts_log_html_ascii_table[] = {
> -	{ '"',	"&quot;" },
> -	{ '&', 	"&amp;" },
> -	{ '<', 	"&lt;" },
> -	{ '>',	"&gt;" },
> -	{ '{',	"&#123;" },
> -	{ '|',	"&#124;" },
> -	{ '}',	"&#125;" },
> -	{ '~',	"&#126;" },
> -
> -	{ 160,	"&nbsp;" },
> -	{ 161,	"&iexl;" },
> -	{ 162,	"&cent;" },
> -	{ 163,	"&pound;" },
> -	{ 164,	"&curren;" },
> -	{ 165,	"&yen;" },
> -	{ 166,	"&brvbar;" },
> -	{ 167,	"&sect;" },
> -	{ 168,	"&uml;" },
> -	{ 169,	"&copy;" },
> -	{ 170,	"&ordf;" },
> -	{ 171,	"&laquo;" },
> -	{ 172,	"&not;" },
> -	{ 173,	"&shy;" },
> -	{ 174,	"&reg;" },
> -	{ 175,	"&macr;" },
> -
> -	{ 176,	"&deg;" },
> -	{ 177,	"&plusmn;" },
> -	{ 178,	"&sup2;" },
> -	{ 179,	"&sup3;" },
> -	{ 180,	"&acute;" },
> -	{ 181,	"&micro;" },
> -	{ 182,	"&para;" },
> -	{ 183,	"&middot;" },
> -	{ 184,	"&cedil;" },
> -	{ 185,	"&sup1;" },
> -	{ 186,	"&ordm;" },
> -	{ 187,	"&raquo;" },
> -	{ 187,	"&frac14;" },
> -	{ 189,	"&frac12;" },
> -	{ 190,	"&frac34;" },
> -	{ 191,	"&iquest;" },
> -
> -	/* Probably never used, but here in case */
> -
> -	{ 192,	"&Agrave;" },
> -	{ 193,	"&Aacute;" },
> -	{ 194,	"&Acirc;" },
> -	{ 195,	"&Atilde;" },
> -	{ 196,	"&Auml;" },
> -	{ 197,	"&Aring;" },
> -	{ 198,	"&AElig;" },
> -	{ 199,	"&Ccedil;" },
> -	{ 200,	"&Egrave;" },
> -	{ 201,	"&Eacute;" },
> -	{ 202,	"&Ecirc;" },
> -	{ 203,	"&Euml;" },
> -	{ 204,	"&lgrave;" },
> -	{ 205,	"&lacute;" },
> -	{ 206,	"&lcirc;" },
> -	{ 207,	"&luml;" },
> -
> -	{ 208,	"&ETH;" },
> -	{ 209,	"&Ntilde;" },
> -	{ 210,	"&Ograve;" },
> -	{ 211,	"&Oacute;" },
> -	{ 212,	"&Ocirc;" },
> -	{ 213,	"&Otilde;" },
> -	{ 214,	"&Ouml;" },
> -	{ 215,	"&times;" },
> -	{ 216,	"&Oslash;" },
> -	{ 217,	"&Ugrave;" },
> -	{ 218,	"&Uacute;" },
> -	{ 219,	"&Ucirc;" },
> -	{ 220,	"&Uuml;" },
> -	{ 221,	"&Yacute;" },
> -	{ 222,	"&THORN;" },
> -	{ 223,	"&szlig;" },
> -
> -	{ 224,	"&agrave;" },
> -	{ 225,	"&aacute;" },
> -	{ 226,	"&acirc;" },
> -	{ 227,	"&atilde;" },
> -	{ 228,	"&auml;" },
> -	{ 229,	"&aring;" },
> -	{ 230,	"&aelig;" },
> -	{ 231,	"&ccedil;" },
> -	{ 232,	"&egrave;" },
> -	{ 233,	"&eacute;" },
> -	{ 234,	"&ecirc;" },
> -	{ 235,	"&emuml;" },
> -	{ 236,	"&igrave;" },
> -	{ 237,	"&iacute;" },
> -	{ 238,	"&icirc;" },
> -	{ 239,	"&iuml;" },
> -
> -	{ 240,	"&eth;" },
> -	{ 241,	"&ntilde;" },
> -	{ 242,	"&ograve;" },
> -	{ 243,	"&oacute;" },
> -	{ 244,	"&ocirc;" },
> -	{ 245,	"&otilde;" },
> -	{ 246,	"&ouml;" },
> -	{ 247,	"&divide;" },
> -	{ 248,	"&oslash;" },
> -	{ 249,	"&ugrave;" },
> -	{ 250,	"&uacute;" },
> -	{ 251,	"&ucirc;" },
> -	{ 252,	"&uuml;" },
> -	{ 253,	"&yacute;" },
> -	{ 254,	"&thorn;" },
> -	{ 255,	"&yuml;" },
> -
> -	{ 0, 	NULL },
> -};
> -
>  static fwts_log_html_stack_t html_stack[MAX_HTML_STACK];
>  static int html_stack_index = 0;
>  
> @@ -184,6 +62,128 @@ static void fwts_log_html(fwts_log_file *log_file, const char *fmt, ...)
>   */
>  static char *fwts_log_html_convert_ascii(const char ch)
>  {
> +	/*
> +	 * ASCII to HTML conversion table:
> +	 * ISO 10646, ISO 8879, ISO 8859-1 Latin alphabet No. 1
> +	 * Browser support: All browsers
> +	 */
> +	static const fwts_log_html_ascii_t fwts_log_html_ascii_table[] = {
> +		{ '"',	"&quot;" },
> +		{ '&', 	"&amp;" },
> +		{ '<', 	"&lt;" },
> +		{ '>',	"&gt;" },
> +		{ '{',	"&#123;" },
> +		{ '|',	"&#124;" },
> +		{ '}',	"&#125;" },
> +		{ '~',	"&#126;" },
> +
> +		{ 160,	"&nbsp;" },
> +		{ 161,	"&iexl;" },
> +		{ 162,	"&cent;" },
> +		{ 163,	"&pound;" },
> +		{ 164,	"&curren;" },
> +		{ 165,	"&yen;" },
> +		{ 166,	"&brvbar;" },
> +		{ 167,	"&sect;" },
> +		{ 168,	"&uml;" },
> +		{ 169,	"&copy;" },
> +		{ 170,	"&ordf;" },
> +		{ 171,	"&laquo;" },
> +		{ 172,	"&not;" },
> +		{ 173,	"&shy;" },
> +		{ 174,	"&reg;" },
> +		{ 175,	"&macr;" },
> +
> +		{ 176,	"&deg;" },
> +		{ 177,	"&plusmn;" },
> +		{ 178,	"&sup2;" },
> +		{ 179,	"&sup3;" },
> +		{ 180,	"&acute;" },
> +		{ 181,	"&micro;" },
> +		{ 182,	"&para;" },
> +		{ 183,	"&middot;" },
> +		{ 184,	"&cedil;" },
> +		{ 185,	"&sup1;" },
> +		{ 186,	"&ordm;" },
> +		{ 187,	"&raquo;" },
> +		{ 187,	"&frac14;" },
> +		{ 189,	"&frac12;" },
> +		{ 190,	"&frac34;" },
> +		{ 191,	"&iquest;" },
> +
> +		/* Probably never used, but here in case */
> +
> +		{ 192,	"&Agrave;" },
> +		{ 193,	"&Aacute;" },
> +		{ 194,	"&Acirc;" },
> +		{ 195,	"&Atilde;" },
> +		{ 196,	"&Auml;" },
> +		{ 197,	"&Aring;" },
> +		{ 198,	"&AElig;" },
> +		{ 199,	"&Ccedil;" },
> +		{ 200,	"&Egrave;" },
> +		{ 201,	"&Eacute;" },
> +		{ 202,	"&Ecirc;" },
> +		{ 203,	"&Euml;" },
> +		{ 204,	"&lgrave;" },
> +		{ 205,	"&lacute;" },
> +		{ 206,	"&lcirc;" },
> +		{ 207,	"&luml;" },
> +
> +		{ 208,	"&ETH;" },
> +		{ 209,	"&Ntilde;" },
> +		{ 210,	"&Ograve;" },
> +		{ 211,	"&Oacute;" },
> +		{ 212,	"&Ocirc;" },
> +		{ 213,	"&Otilde;" },
> +		{ 214,	"&Ouml;" },
> +		{ 215,	"&times;" },
> +		{ 216,	"&Oslash;" },
> +		{ 217,	"&Ugrave;" },
> +		{ 218,	"&Uacute;" },
> +		{ 219,	"&Ucirc;" },
> +		{ 220,	"&Uuml;" },
> +		{ 221,	"&Yacute;" },
> +		{ 222,	"&THORN;" },
> +		{ 223,	"&szlig;" },
> +
> +		{ 224,	"&agrave;" },
> +		{ 225,	"&aacute;" },
> +		{ 226,	"&acirc;" },
> +		{ 227,	"&atilde;" },
> +		{ 228,	"&auml;" },
> +		{ 229,	"&aring;" },
> +		{ 230,	"&aelig;" },
> +		{ 231,	"&ccedil;" },
> +		{ 232,	"&egrave;" },
> +		{ 233,	"&eacute;" },
> +		{ 234,	"&ecirc;" },
> +		{ 235,	"&emuml;" },
> +		{ 236,	"&igrave;" },
> +		{ 237,	"&iacute;" },
> +		{ 238,	"&icirc;" },
> +		{ 239,	"&iuml;" },
> +
> +		{ 240,	"&eth;" },
> +		{ 241,	"&ntilde;" },
> +		{ 242,	"&ograve;" },
> +		{ 243,	"&oacute;" },
> +		{ 244,	"&ocirc;" },
> +		{ 245,	"&otilde;" },
> +		{ 246,	"&ouml;" },
> +		{ 247,	"&divide;" },
> +		{ 248,	"&oslash;" },
> +		{ 249,	"&ugrave;" },
> +		{ 250,	"&uacute;" },
> +		{ 251,	"&ucirc;" },
> +		{ 252,	"&uuml;" },
> +		{ 253,	"&yacute;" },
> +		{ 254,	"&thorn;" },
> +		{ 255,	"&yuml;" },
> +
> +		{ 0, 	NULL },
> +	};
> +
>  	int i;
>  	static char buf[2];
>  
> 

Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu April 12, 2021, 7:34 a.m. UTC | #2
On 4/11/21 9:39 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The scope of array fwts_log_html_ascii_table is limited to just
> function fwts_log_html_convert_ascii so move it into the function.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/lib/src/fwts_log_html.c | 244 ++++++++++++++++++------------------
>  1 file changed, 122 insertions(+), 122 deletions(-)
> 
> diff --git a/src/lib/src/fwts_log_html.c b/src/lib/src/fwts_log_html.c
> index 4397a3f1..eca8e666 100644
> --- a/src/lib/src/fwts_log_html.c
> +++ b/src/lib/src/fwts_log_html.c
> @@ -39,128 +39,6 @@ typedef struct {
>  	char *		html;	/* HTML equivalent */
>  } fwts_log_html_ascii_t;
>  
> -/*
> - * ASCII to HTML conversion table:
> - * ISO 10646, ISO 8879, ISO 8859-1 Latin alphabet No. 1
> - * Browser support: All browsers
> - */
> -static const fwts_log_html_ascii_t fwts_log_html_ascii_table[] = {
> -	{ '"',	"&quot;" },
> -	{ '&', 	"&amp;" },
> -	{ '<', 	"&lt;" },
> -	{ '>',	"&gt;" },
> -	{ '{',	"&#123;" },
> -	{ '|',	"&#124;" },
> -	{ '}',	"&#125;" },
> -	{ '~',	"&#126;" },
> -
> -	{ 160,	"&nbsp;" },
> -	{ 161,	"&iexl;" },
> -	{ 162,	"&cent;" },
> -	{ 163,	"&pound;" },
> -	{ 164,	"&curren;" },
> -	{ 165,	"&yen;" },
> -	{ 166,	"&brvbar;" },
> -	{ 167,	"&sect;" },
> -	{ 168,	"&uml;" },
> -	{ 169,	"&copy;" },
> -	{ 170,	"&ordf;" },
> -	{ 171,	"&laquo;" },
> -	{ 172,	"&not;" },
> -	{ 173,	"&shy;" },
> -	{ 174,	"&reg;" },
> -	{ 175,	"&macr;" },
> -
> -	{ 176,	"&deg;" },
> -	{ 177,	"&plusmn;" },
> -	{ 178,	"&sup2;" },
> -	{ 179,	"&sup3;" },
> -	{ 180,	"&acute;" },
> -	{ 181,	"&micro;" },
> -	{ 182,	"&para;" },
> -	{ 183,	"&middot;" },
> -	{ 184,	"&cedil;" },
> -	{ 185,	"&sup1;" },
> -	{ 186,	"&ordm;" },
> -	{ 187,	"&raquo;" },
> -	{ 187,	"&frac14;" },
> -	{ 189,	"&frac12;" },
> -	{ 190,	"&frac34;" },
> -	{ 191,	"&iquest;" },
> -
> -	/* Probably never used, but here in case */
> -
> -	{ 192,	"&Agrave;" },
> -	{ 193,	"&Aacute;" },
> -	{ 194,	"&Acirc;" },
> -	{ 195,	"&Atilde;" },
> -	{ 196,	"&Auml;" },
> -	{ 197,	"&Aring;" },
> -	{ 198,	"&AElig;" },
> -	{ 199,	"&Ccedil;" },
> -	{ 200,	"&Egrave;" },
> -	{ 201,	"&Eacute;" },
> -	{ 202,	"&Ecirc;" },
> -	{ 203,	"&Euml;" },
> -	{ 204,	"&lgrave;" },
> -	{ 205,	"&lacute;" },
> -	{ 206,	"&lcirc;" },
> -	{ 207,	"&luml;" },
> -
> -	{ 208,	"&ETH;" },
> -	{ 209,	"&Ntilde;" },
> -	{ 210,	"&Ograve;" },
> -	{ 211,	"&Oacute;" },
> -	{ 212,	"&Ocirc;" },
> -	{ 213,	"&Otilde;" },
> -	{ 214,	"&Ouml;" },
> -	{ 215,	"&times;" },
> -	{ 216,	"&Oslash;" },
> -	{ 217,	"&Ugrave;" },
> -	{ 218,	"&Uacute;" },
> -	{ 219,	"&Ucirc;" },
> -	{ 220,	"&Uuml;" },
> -	{ 221,	"&Yacute;" },
> -	{ 222,	"&THORN;" },
> -	{ 223,	"&szlig;" },
> -
> -	{ 224,	"&agrave;" },
> -	{ 225,	"&aacute;" },
> -	{ 226,	"&acirc;" },
> -	{ 227,	"&atilde;" },
> -	{ 228,	"&auml;" },
> -	{ 229,	"&aring;" },
> -	{ 230,	"&aelig;" },
> -	{ 231,	"&ccedil;" },
> -	{ 232,	"&egrave;" },
> -	{ 233,	"&eacute;" },
> -	{ 234,	"&ecirc;" },
> -	{ 235,	"&emuml;" },
> -	{ 236,	"&igrave;" },
> -	{ 237,	"&iacute;" },
> -	{ 238,	"&icirc;" },
> -	{ 239,	"&iuml;" },
> -
> -	{ 240,	"&eth;" },
> -	{ 241,	"&ntilde;" },
> -	{ 242,	"&ograve;" },
> -	{ 243,	"&oacute;" },
> -	{ 244,	"&ocirc;" },
> -	{ 245,	"&otilde;" },
> -	{ 246,	"&ouml;" },
> -	{ 247,	"&divide;" },
> -	{ 248,	"&oslash;" },
> -	{ 249,	"&ugrave;" },
> -	{ 250,	"&uacute;" },
> -	{ 251,	"&ucirc;" },
> -	{ 252,	"&uuml;" },
> -	{ 253,	"&yacute;" },
> -	{ 254,	"&thorn;" },
> -	{ 255,	"&yuml;" },
> -
> -	{ 0, 	NULL },
> -};
> -
>  static fwts_log_html_stack_t html_stack[MAX_HTML_STACK];
>  static int html_stack_index = 0;
>  
> @@ -184,6 +62,128 @@ static void fwts_log_html(fwts_log_file *log_file, const char *fmt, ...)
>   */
>  static char *fwts_log_html_convert_ascii(const char ch)
>  {
> +	/*
> +	 * ASCII to HTML conversion table:
> +	 * ISO 10646, ISO 8879, ISO 8859-1 Latin alphabet No. 1
> +	 * Browser support: All browsers
> +	 */
> +	static const fwts_log_html_ascii_t fwts_log_html_ascii_table[] = {
> +		{ '"',	"&quot;" },
> +		{ '&', 	"&amp;" },
> +		{ '<', 	"&lt;" },
> +		{ '>',	"&gt;" },
> +		{ '{',	"&#123;" },
> +		{ '|',	"&#124;" },
> +		{ '}',	"&#125;" },
> +		{ '~',	"&#126;" },
> +
> +		{ 160,	"&nbsp;" },
> +		{ 161,	"&iexl;" },
> +		{ 162,	"&cent;" },
> +		{ 163,	"&pound;" },
> +		{ 164,	"&curren;" },
> +		{ 165,	"&yen;" },
> +		{ 166,	"&brvbar;" },
> +		{ 167,	"&sect;" },
> +		{ 168,	"&uml;" },
> +		{ 169,	"&copy;" },
> +		{ 170,	"&ordf;" },
> +		{ 171,	"&laquo;" },
> +		{ 172,	"&not;" },
> +		{ 173,	"&shy;" },
> +		{ 174,	"&reg;" },
> +		{ 175,	"&macr;" },
> +
> +		{ 176,	"&deg;" },
> +		{ 177,	"&plusmn;" },
> +		{ 178,	"&sup2;" },
> +		{ 179,	"&sup3;" },
> +		{ 180,	"&acute;" },
> +		{ 181,	"&micro;" },
> +		{ 182,	"&para;" },
> +		{ 183,	"&middot;" },
> +		{ 184,	"&cedil;" },
> +		{ 185,	"&sup1;" },
> +		{ 186,	"&ordm;" },
> +		{ 187,	"&raquo;" },
> +		{ 187,	"&frac14;" },
> +		{ 189,	"&frac12;" },
> +		{ 190,	"&frac34;" },
> +		{ 191,	"&iquest;" },
> +
> +		/* Probably never used, but here in case */
> +
> +		{ 192,	"&Agrave;" },
> +		{ 193,	"&Aacute;" },
> +		{ 194,	"&Acirc;" },
> +		{ 195,	"&Atilde;" },
> +		{ 196,	"&Auml;" },
> +		{ 197,	"&Aring;" },
> +		{ 198,	"&AElig;" },
> +		{ 199,	"&Ccedil;" },
> +		{ 200,	"&Egrave;" },
> +		{ 201,	"&Eacute;" },
> +		{ 202,	"&Ecirc;" },
> +		{ 203,	"&Euml;" },
> +		{ 204,	"&lgrave;" },
> +		{ 205,	"&lacute;" },
> +		{ 206,	"&lcirc;" },
> +		{ 207,	"&luml;" },
> +
> +		{ 208,	"&ETH;" },
> +		{ 209,	"&Ntilde;" },
> +		{ 210,	"&Ograve;" },
> +		{ 211,	"&Oacute;" },
> +		{ 212,	"&Ocirc;" },
> +		{ 213,	"&Otilde;" },
> +		{ 214,	"&Ouml;" },
> +		{ 215,	"&times;" },
> +		{ 216,	"&Oslash;" },
> +		{ 217,	"&Ugrave;" },
> +		{ 218,	"&Uacute;" },
> +		{ 219,	"&Ucirc;" },
> +		{ 220,	"&Uuml;" },
> +		{ 221,	"&Yacute;" },
> +		{ 222,	"&THORN;" },
> +		{ 223,	"&szlig;" },
> +
> +		{ 224,	"&agrave;" },
> +		{ 225,	"&aacute;" },
> +		{ 226,	"&acirc;" },
> +		{ 227,	"&atilde;" },
> +		{ 228,	"&auml;" },
> +		{ 229,	"&aring;" },
> +		{ 230,	"&aelig;" },
> +		{ 231,	"&ccedil;" },
> +		{ 232,	"&egrave;" },
> +		{ 233,	"&eacute;" },
> +		{ 234,	"&ecirc;" },
> +		{ 235,	"&emuml;" },
> +		{ 236,	"&igrave;" },
> +		{ 237,	"&iacute;" },
> +		{ 238,	"&icirc;" },
> +		{ 239,	"&iuml;" },
> +
> +		{ 240,	"&eth;" },
> +		{ 241,	"&ntilde;" },
> +		{ 242,	"&ograve;" },
> +		{ 243,	"&oacute;" },
> +		{ 244,	"&ocirc;" },
> +		{ 245,	"&otilde;" },
> +		{ 246,	"&ouml;" },
> +		{ 247,	"&divide;" },
> +		{ 248,	"&oslash;" },
> +		{ 249,	"&ugrave;" },
> +		{ 250,	"&uacute;" },
> +		{ 251,	"&ucirc;" },
> +		{ 252,	"&uuml;" },
> +		{ 253,	"&yacute;" },
> +		{ 254,	"&thorn;" },
> +		{ 255,	"&yuml;" },
> +
> +		{ 0, 	NULL },
> +	};
> +
>  	int i;
>  	static char buf[2];
>  
> 

Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox series

Patch

diff --git a/src/lib/src/fwts_log_html.c b/src/lib/src/fwts_log_html.c
index 4397a3f1..eca8e666 100644
--- a/src/lib/src/fwts_log_html.c
+++ b/src/lib/src/fwts_log_html.c
@@ -39,128 +39,6 @@  typedef struct {
 	char *		html;	/* HTML equivalent */
 } fwts_log_html_ascii_t;
 
-/*
- * ASCII to HTML conversion table:
- * ISO 10646, ISO 8879, ISO 8859-1 Latin alphabet No. 1
- * Browser support: All browsers
- */
-static const fwts_log_html_ascii_t fwts_log_html_ascii_table[] = {
-	{ '"',	"&quot;" },
-	{ '&', 	"&amp;" },
-	{ '<', 	"&lt;" },
-	{ '>',	"&gt;" },
-	{ '{',	"&#123;" },
-	{ '|',	"&#124;" },
-	{ '}',	"&#125;" },
-	{ '~',	"&#126;" },
-
-	{ 160,	"&nbsp;" },
-	{ 161,	"&iexl;" },
-	{ 162,	"&cent;" },
-	{ 163,	"&pound;" },
-	{ 164,	"&curren;" },
-	{ 165,	"&yen;" },
-	{ 166,	"&brvbar;" },
-	{ 167,	"&sect;" },
-	{ 168,	"&uml;" },
-	{ 169,	"&copy;" },
-	{ 170,	"&ordf;" },
-	{ 171,	"&laquo;" },
-	{ 172,	"&not;" },
-	{ 173,	"&shy;" },
-	{ 174,	"&reg;" },
-	{ 175,	"&macr;" },
-
-	{ 176,	"&deg;" },
-	{ 177,	"&plusmn;" },
-	{ 178,	"&sup2;" },
-	{ 179,	"&sup3;" },
-	{ 180,	"&acute;" },
-	{ 181,	"&micro;" },
-	{ 182,	"&para;" },
-	{ 183,	"&middot;" },
-	{ 184,	"&cedil;" },
-	{ 185,	"&sup1;" },
-	{ 186,	"&ordm;" },
-	{ 187,	"&raquo;" },
-	{ 187,	"&frac14;" },
-	{ 189,	"&frac12;" },
-	{ 190,	"&frac34;" },
-	{ 191,	"&iquest;" },
-
-	/* Probably never used, but here in case */
-
-	{ 192,	"&Agrave;" },
-	{ 193,	"&Aacute;" },
-	{ 194,	"&Acirc;" },
-	{ 195,	"&Atilde;" },
-	{ 196,	"&Auml;" },
-	{ 197,	"&Aring;" },
-	{ 198,	"&AElig;" },
-	{ 199,	"&Ccedil;" },
-	{ 200,	"&Egrave;" },
-	{ 201,	"&Eacute;" },
-	{ 202,	"&Ecirc;" },
-	{ 203,	"&Euml;" },
-	{ 204,	"&lgrave;" },
-	{ 205,	"&lacute;" },
-	{ 206,	"&lcirc;" },
-	{ 207,	"&luml;" },
-
-	{ 208,	"&ETH;" },
-	{ 209,	"&Ntilde;" },
-	{ 210,	"&Ograve;" },
-	{ 211,	"&Oacute;" },
-	{ 212,	"&Ocirc;" },
-	{ 213,	"&Otilde;" },
-	{ 214,	"&Ouml;" },
-	{ 215,	"&times;" },
-	{ 216,	"&Oslash;" },
-	{ 217,	"&Ugrave;" },
-	{ 218,	"&Uacute;" },
-	{ 219,	"&Ucirc;" },
-	{ 220,	"&Uuml;" },
-	{ 221,	"&Yacute;" },
-	{ 222,	"&THORN;" },
-	{ 223,	"&szlig;" },
-
-	{ 224,	"&agrave;" },
-	{ 225,	"&aacute;" },
-	{ 226,	"&acirc;" },
-	{ 227,	"&atilde;" },
-	{ 228,	"&auml;" },
-	{ 229,	"&aring;" },
-	{ 230,	"&aelig;" },
-	{ 231,	"&ccedil;" },
-	{ 232,	"&egrave;" },
-	{ 233,	"&eacute;" },
-	{ 234,	"&ecirc;" },
-	{ 235,	"&emuml;" },
-	{ 236,	"&igrave;" },
-	{ 237,	"&iacute;" },
-	{ 238,	"&icirc;" },
-	{ 239,	"&iuml;" },
-
-	{ 240,	"&eth;" },
-	{ 241,	"&ntilde;" },
-	{ 242,	"&ograve;" },
-	{ 243,	"&oacute;" },
-	{ 244,	"&ocirc;" },
-	{ 245,	"&otilde;" },
-	{ 246,	"&ouml;" },
-	{ 247,	"&divide;" },
-	{ 248,	"&oslash;" },
-	{ 249,	"&ugrave;" },
-	{ 250,	"&uacute;" },
-	{ 251,	"&ucirc;" },
-	{ 252,	"&uuml;" },
-	{ 253,	"&yacute;" },
-	{ 254,	"&thorn;" },
-	{ 255,	"&yuml;" },
-
-	{ 0, 	NULL },
-};
-
 static fwts_log_html_stack_t html_stack[MAX_HTML_STACK];
 static int html_stack_index = 0;
 
@@ -184,6 +62,128 @@  static void fwts_log_html(fwts_log_file *log_file, const char *fmt, ...)
  */
 static char *fwts_log_html_convert_ascii(const char ch)
 {
+	/*
+	 * ASCII to HTML conversion table:
+	 * ISO 10646, ISO 8879, ISO 8859-1 Latin alphabet No. 1
+	 * Browser support: All browsers
+	 */
+	static const fwts_log_html_ascii_t fwts_log_html_ascii_table[] = {
+		{ '"',	"&quot;" },
+		{ '&', 	"&amp;" },
+		{ '<', 	"&lt;" },
+		{ '>',	"&gt;" },
+		{ '{',	"&#123;" },
+		{ '|',	"&#124;" },
+		{ '}',	"&#125;" },
+		{ '~',	"&#126;" },
+
+		{ 160,	"&nbsp;" },
+		{ 161,	"&iexl;" },
+		{ 162,	"&cent;" },
+		{ 163,	"&pound;" },
+		{ 164,	"&curren;" },
+		{ 165,	"&yen;" },
+		{ 166,	"&brvbar;" },
+		{ 167,	"&sect;" },
+		{ 168,	"&uml;" },
+		{ 169,	"&copy;" },
+		{ 170,	"&ordf;" },
+		{ 171,	"&laquo;" },
+		{ 172,	"&not;" },
+		{ 173,	"&shy;" },
+		{ 174,	"&reg;" },
+		{ 175,	"&macr;" },
+
+		{ 176,	"&deg;" },
+		{ 177,	"&plusmn;" },
+		{ 178,	"&sup2;" },
+		{ 179,	"&sup3;" },
+		{ 180,	"&acute;" },
+		{ 181,	"&micro;" },
+		{ 182,	"&para;" },
+		{ 183,	"&middot;" },
+		{ 184,	"&cedil;" },
+		{ 185,	"&sup1;" },
+		{ 186,	"&ordm;" },
+		{ 187,	"&raquo;" },
+		{ 187,	"&frac14;" },
+		{ 189,	"&frac12;" },
+		{ 190,	"&frac34;" },
+		{ 191,	"&iquest;" },
+
+		/* Probably never used, but here in case */
+
+		{ 192,	"&Agrave;" },
+		{ 193,	"&Aacute;" },
+		{ 194,	"&Acirc;" },
+		{ 195,	"&Atilde;" },
+		{ 196,	"&Auml;" },
+		{ 197,	"&Aring;" },
+		{ 198,	"&AElig;" },
+		{ 199,	"&Ccedil;" },
+		{ 200,	"&Egrave;" },
+		{ 201,	"&Eacute;" },
+		{ 202,	"&Ecirc;" },
+		{ 203,	"&Euml;" },
+		{ 204,	"&lgrave;" },
+		{ 205,	"&lacute;" },
+		{ 206,	"&lcirc;" },
+		{ 207,	"&luml;" },
+
+		{ 208,	"&ETH;" },
+		{ 209,	"&Ntilde;" },
+		{ 210,	"&Ograve;" },
+		{ 211,	"&Oacute;" },
+		{ 212,	"&Ocirc;" },
+		{ 213,	"&Otilde;" },
+		{ 214,	"&Ouml;" },
+		{ 215,	"&times;" },
+		{ 216,	"&Oslash;" },
+		{ 217,	"&Ugrave;" },
+		{ 218,	"&Uacute;" },
+		{ 219,	"&Ucirc;" },
+		{ 220,	"&Uuml;" },
+		{ 221,	"&Yacute;" },
+		{ 222,	"&THORN;" },
+		{ 223,	"&szlig;" },
+
+		{ 224,	"&agrave;" },
+		{ 225,	"&aacute;" },
+		{ 226,	"&acirc;" },
+		{ 227,	"&atilde;" },
+		{ 228,	"&auml;" },
+		{ 229,	"&aring;" },
+		{ 230,	"&aelig;" },
+		{ 231,	"&ccedil;" },
+		{ 232,	"&egrave;" },
+		{ 233,	"&eacute;" },
+		{ 234,	"&ecirc;" },
+		{ 235,	"&emuml;" },
+		{ 236,	"&igrave;" },
+		{ 237,	"&iacute;" },
+		{ 238,	"&icirc;" },
+		{ 239,	"&iuml;" },
+
+		{ 240,	"&eth;" },
+		{ 241,	"&ntilde;" },
+		{ 242,	"&ograve;" },
+		{ 243,	"&oacute;" },
+		{ 244,	"&ocirc;" },
+		{ 245,	"&otilde;" },
+		{ 246,	"&ouml;" },
+		{ 247,	"&divide;" },
+		{ 248,	"&oslash;" },
+		{ 249,	"&ugrave;" },
+		{ 250,	"&uacute;" },
+		{ 251,	"&ucirc;" },
+		{ 252,	"&uuml;" },
+		{ 253,	"&yacute;" },
+		{ 254,	"&thorn;" },
+		{ 255,	"&yuml;" },
+
+		{ 0, 	NULL },
+	};
+
 	int i;
 	static char buf[2];