glibc/locale
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
..
bits Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
programs locale: localdef input files are now encoded in UTF-8 2022-07-05 09:06:50 +02:00
tst-localedef-path-norm.root localedef: Add verbose messages for failure paths. 2020-04-26 13:55:58 -04:00
broken_cur_max.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
C_name.c Update. 2001-04-06 17:49:18 +00:00
C-address.c locale: Remove private union from struct __locale_data 2022-05-23 11:06:31 +02:00
C-collate-seq.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
C-collate.c locale: Remove private union from struct __locale_data 2022-05-23 11:06:31 +02:00
C-ctype.c locale: Add more cached data to LC_CTYPE 2022-05-23 11:06:31 +02:00
C-identification.c locale: Remove private union from struct __locale_data 2022-05-23 11:06:31 +02:00
C-measurement.c locale: Remove private union from struct __locale_data 2022-05-23 11:06:31 +02:00
C-messages.c locale: Remove private union from struct __locale_data 2022-05-23 11:06:31 +02:00
C-monetary.c locale: Remove private union from struct __locale_data 2022-05-23 11:06:31 +02:00
C-name.c locale: Remove private union from struct __locale_data 2022-05-23 11:06:31 +02:00
C-numeric.c locale: Remove private union from struct __locale_data 2022-05-23 11:06:31 +02:00
C-paper.c locale: Remove private union from struct __locale_data 2022-05-23 11:06:31 +02:00
C-telephone.c locale: Remove private union from struct __locale_data 2022-05-23 11:06:31 +02:00
C-time.c locale: Remove private union from struct __locale_data 2022-05-23 11:06:31 +02:00
C-translit.h.in Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
categories.def Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
coll-lookup.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
coll-lookup.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
duplocale.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
elem-hash.h Replace {u}int_fast{16|32} with {u}int32_t 2022-04-13 21:23:04 -05:00
findlocale.c locale: Remove cleanup function pointer from struct __localedata 2022-05-23 11:06:31 +02:00
freelocale.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
gen-translit.py Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
global-locale.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
hashval.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
indigits.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
indigitswc.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
iso-639.def Add rif_MA locale [BZ #27781] 2022-04-07 14:59:41 +02:00
iso-3166.def Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
iso-4217.def Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
langinfo.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
lc-address.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
lc-collate.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
lc-ctype.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
lc-identification.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
lc-measurement.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
lc-messages.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
lc-monetary.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
lc-name.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
lc-numeric.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
lc-paper.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
lc-telephone.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
lc-time.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
loadarchive.c locale: Remove cleanup function pointer from struct __localedata 2022-05-23 11:06:31 +02:00
loadlocale.c locale: Add more cached data to LC_CTYPE 2022-05-23 11:06:31 +02:00
locale.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
localeconv.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
localeinfo.h locale: Add more cached data to LC_CTYPE 2022-05-23 11:06:31 +02:00
localename.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
locarchive.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
Makefile Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
mb_cur_max.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
newlocale.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
nl_langinfo_l.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
nl_langinfo.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
outdigits.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
outdigitswc.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
setlocale.c locale: Remove cleanup function pointer from struct __localedata 2022-05-23 11:06:31 +02:00
strlen-hash.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
SYS_libc.c [BZ #284, BZ #721] 2005-02-17 01:19:55 +00:00
tst-C-locale.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-duplocale.c Add missing test files. 2009-11-17 16:23:57 -08:00
tst-locale-locpath.sh Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-localedef-path-norm.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-locname.c Add missing test files. 2009-11-17 16:23:57 -08:00
uselocale.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
Versions * sysdeps/ia64/dl-fptr.c (__ia64_make_fptr): Revert last change. 2003-03-03 09:45:25 +00:00
weight.h Replace {u}int_fast{16|32} with {u}int32_t 2022-04-13 21:23:04 -05:00
weightwc.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
xlocale.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00