aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-01-31 18:34:37 +0000
committerJohn Ankarström <john@ankarstrom.se>2021-01-31 18:34:37 +0000
commit78260be6f8800d79308599d8376c0c4f7f7dda2a (patch)
treebfdaff613e9e3fe00e15e3857f24a0ac97bb7378
parente17d5accf61e817fd71de5ea0e5c22b154d3d436 (diff)
downloadem-78260be6f8800d79308599d8376c0c4f7f7dda2a.tar.gz
htwrap: Use UTF-8 charset by default, add -C option to disable
-rwxr-xr-xhtwrap10
1 files changed, 7 insertions, 3 deletions
diff --git a/htwrap b/htwrap
index 97fa445..32f38aa 100755
--- a/htwrap
+++ b/htwrap
@@ -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)