From b15538d77c6a7893c8bb42831dcd3a1a12b727d4 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Tue, 5 Jul 2022 09:05:45 +0200 Subject: 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 "" nil t) (let* ((codepoint (string-to-number (match-string 1) 16)) (converted (cond ((memq codepoint '(?/ ?\ ?< ?>)) (string ?/ codepoint)) ((= codepoint ?\") "") (t (string codepoint))))) (replace-match converted t))))))) Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'NEWS') diff --git a/NEWS b/NEWS index b0a3d7e..163bcfa 100644 --- a/NEWS +++ b/NEWS @@ -46,6 +46,10 @@ Major new features: to more flexibly configure and operate on filesystem mounts. The new mount APIs are specifically designed to work with namespaces. +* localedef now accepts locale definition files encoded in UTF-8. + Previously, input bytes not within the ASCII range resulted in + unpredictable output. + Deprecated and removed features, and other changes affecting compatibility: * Support for prelink will be removed in the next release; this includes -- cgit v1.1