glibc/locale/programs
Florian Weimer b15538d77c locale: localdef input files are now encoded in UTF-8
Previously, they were assumed to be in ISO-8859-1, and that the output
charset overlapped with ISO-8859-1 for the characters actually used.
However, this did not work as intended on many architectures even for
an ISO-8859-1 output encoding because of the char signedness bug in
lr_getc.  Therefore, this commit switches to UTF-8 without making
provisions for backwards compatibility.

The following Elisp code can be used to convert locale definition files
to UTF-8:

(defun glibc/convert-localedef (from to)
  (interactive "r")
  (save-excursion
    (save-restriction
      (narrow-to-region from to)
      (goto-char (point-min))
      (save-match-data
	(while (re-search-forward "<U\\([0-9a-fA-F]+\\)>" nil t)
	  (let* ((codepoint (string-to-number (match-string 1) 16))
		 (converted
		  (cond
		   ((memq codepoint '(?/ ?\ ?< ?>))
		    (string ?/ codepoint))
		   ((= codepoint ?\") "<U0022>")
		   (t (string codepoint)))))
	    (replace-match converted t)))))))

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2022-07-05 09:06:50 +02:00
..
3level.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
charmap-dir.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
charmap-dir.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
charmap-kw.gperf Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
charmap-kw.h Update automatically-generated copyright dates 2022-01-01 11:42:26 -08:00
charmap.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
charmap.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
config.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
ld-address.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
ld-collate.c locale: Remove set but unused variable on ld-collate.c 2022-03-31 08:53:40 -03:00
ld-ctype.c locale: Remove ununsed wctype_table_get function 2022-03-23 14:32:23 -03:00
ld-identification.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
ld-measurement.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
ld-messages.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
ld-monetary.c localedef: Update LC_MONETARY handling (Bug 28845) 2022-02-25 07:31:27 -05:00
ld-name.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
ld-numeric.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
ld-paper.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
ld-telephone.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
ld-time.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
linereader.c locale: localdef input files are now encoded in UTF-8 2022-07-05 09:06:50 +02:00
linereader.h locale: Fix signed char bug in lr_getc 2022-07-05 09:06:28 +02:00
locale-spec.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
locale.c Update copyright dates not handled by scripts/update-copyrights. 2022-01-01 11:42:26 -08:00
localedef.c Update copyright dates not handled by scripts/update-copyrights. 2022-01-01 11:42:26 -08:00
localedef.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
locarchive.c localedef: Handle symbolic links when generating locale-archive 2022-02-24 22:45:05 +01:00
locfile-kw.gperf Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
locfile-kw.h Update automatically-generated copyright dates 2022-01-01 11:42:26 -08:00
locfile-token.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
locfile.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
locfile.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
record-status.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
record-status.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
repertoire.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
repertoire.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
simple-hash.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
simple-hash.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
xasprintf.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
xmalloc.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
xstrdup.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00