[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4325-g6db264b
From: |
Arnold Robbins |
Subject: |
[SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4325-g6db264b |
Date: |
Sat, 9 Oct 2021 15:17:22 -0400 (EDT) |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".
The branch, gawk-5.1-stable has been updated
via 6db264b1f346896f18fa705023594e5d4d789f04 (commit)
from 589d91eeb99bf2c7dcd6a4310f5964739b9c8edb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=6db264b1f346896f18fa705023594e5d4d789f04
commit 6db264b1f346896f18fa705023594e5d4d789f04
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Sat Oct 9 22:16:58 2021 +0300
New script in helpers to find UTF in doc files.
diff --git a/helpers/ChangeLog b/helpers/ChangeLog
index d8e12b4..6b59f26 100644
--- a/helpers/ChangeLog
+++ b/helpers/ChangeLog
@@ -1,3 +1,7 @@
+2021-10-09 Arnold D. Robbins <arnold@skeeve.com>
+
+ * find-utf.sh: New script.
+
2021-07-15 Arnold D. Robbins <arnold@skeeve.com>
* testdfa.c (main): Bug fix and new -b option.
diff --git a/helpers/find-utf.sh b/helpers/find-utf.sh
new file mode 100755
index 0000000..b608a6f
--- /dev/null
+++ b/helpers/find-utf.sh
@@ -0,0 +1,53 @@
+#! /bin/sh
+export LC_ALL=C
+gawk '
+# ord.awk --- do ord and chr
+
+# Global identifiers:
+# _ord_: numerical values indexed by characters
+# _ord_init: function to initialize _ord_
+#
+# Arnold Robbins, arnold@skeeve.com, Public Domain
+# 16 January, 1992
+# 20 July, 1992, revised
+
+BEGIN { _ord_init() }
+
+function _ord_init( low, high, i, t)
+{
+ low = sprintf("%c", 7) # BEL is ascii 7
+ if (low == "\a") { # regular ascii
+ low = 0
+ high = 255
+ } else if (sprintf("%c", 128 + 7) == "\a") {
+ # ascii, mark parity
+ low = 128
+ high = 255
+ } else { # ebcdic(!)
+ low = 0
+ high = 255
+ }
+
+ for (i = low; i <= high; i++) {
+ t = sprintf("%c", i)
+ _ord_[t] = i
+ }
+}
+function ord(str, c)
+{
+ # only first character is of interest
+ c = substr(str, 1, 1)
+ return _ord_[c]
+}
+
+function chr(c)
+{
+ # force c to be numeric by adding 0
+ return sprintf("%c", c + 0)
+}
+{
+ n = split($0, c, "")
+ for (i = 1; i <= n; i++)
+ if (ord(c[i]) > 127)
+ printf("%d: char: \\%o\n", NR, ord(c[i]))
+}' "$@"
-----------------------------------------------------------------------
Summary of changes:
helpers/ChangeLog | 4 ++++
awklib/eg/lib/ord.awk => helpers/find-utf.sh | 11 ++++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
copy awklib/eg/lib/ord.awk => helpers/find-utf.sh (83%)
mode change 100644 => 100755
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4325-g6db264b,
Arnold Robbins <=