diff options
author | John Ankarström <john@ankarstrom.se> | 2021-01-31 18:34:37 +0000 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-01-31 18:34:37 +0000 |
commit | 78260be6f8800d79308599d8376c0c4f7f7dda2a (patch) | |
tree | bfdaff613e9e3fe00e15e3857f24a0ac97bb7378 /htwrap | |
parent | e17d5accf61e817fd71de5ea0e5c22b154d3d436 (diff) | |
download | em-78260be6f8800d79308599d8376c0c4f7f7dda2a.tar.gz |
htwrap: Use UTF-8 charset by default, add -C option to disable
Diffstat (limited to 'htwrap')
-rwxr-xr-x | htwrap | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -3,7 +3,7 @@ rfork E # htwrap -- create standalone HTML document -flagfmt='t, c charset, d dir, l lang, v doctype' +flagfmt='t,C, c charset, d dir, l lang, v doctype' args='[file ...]' if(! ifs=() eval `{aux/getflags $*}){ @@ -39,8 +39,12 @@ if(! ~ $#flagl 0) echo -n ' lang="'^$flagl^'"' if(! ~ $#flagd 0) echo -n ' dir="'^$flagd^'"' echo '>' -if(! ~ $#flagc 0) - echo '<meta http-equiv="Content-Type" content="text/html; charset='^$flagc^'">' +if(~ $#flagC 0){ + if(! ~ $#flagc 0) + echo '<meta http-equiv="Content-Type" content="text/html; charset='^$flagc^'">' + if not + echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">' +} fn source{ if(! ~ $#* 0) |