[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#312927: glibc: Please use UTF-8 as the default locale codeset



Package: glibc
Severity: normal
Tags: patch

Hi,

UTF-8 is now ready for use as the default character set in Debian.
Most other major distributions (e.g. RedHat, SuSE) switched to
UTF-8 last year, if not before.  We should seriously consider doing
the same.

The current locale package allows one to choose the locales to generate
using debconf, and takes the list from i18n/SUPPORTED.  I don't for one
moment propose to drop any supported locales.  The following patch
reorders SUPPORTED when embedding the list in locales.config, so that
UTF-8 locales are listed before all other locales, which are placed at
the end of the list.  I've also added a small note to the debconf
template to make the user aware that UTF-8 locales are recommended, but
the other locales are still available should they be needed.


Regards,
Roger



--- glibc-2.3.2.ds1.old/debian/rules.d/debhelper.mk	2005-06-10 11:04:53.000000000 +0100
+++ glibc-2.3.2.ds1/debian/rules.d/debhelper.mk	2005-06-10 21:22:07.000000000 +0100
@@ -225,7 +225,7 @@
 	done
 
 	# Substitute __SUPPORTED_LOCALES__.
-	perl -i -pe 'BEGIN {undef $$/; open(IN, "debian/tmp-libc/usr/share/i18n/SUPPORTED"); $$j=<IN>;} s/__SUPPORTED_LOCALES__/$$j/g;' debian/locales.config
+	perl -i -pe 'BEGIN {open(IN, "debian/tmp-libc/usr/share/i18n/SUPPORTED"); $$u = $$j = ""; while (<IN>) { if (/UTF\-8/) { $$u .= $$_; } else { $$j .= $$_; } } $$u .= $$j;} s/__SUPPORTED_LOCALES__/$$u/g;' debian/locales.config
 
 	# Generate common substvars files.
 	echo "locale:Depends=$(shell perl debian/debver2localesdep.pl $(DEB_VERSION))" > tmp.substvars
--- glibc-2.3.2.ds1.old/debian/debhelper.in/locales.templates	2005-06-10 11:04:53.000000000 +0100
+++ glibc-2.3.2.ds1/debian/debhelper.in/locales.templates	2005-06-10 21:35:57.000000000 +0100
@@ -8,6 +8,10 @@
  Choose which locales to generate.  The selection will be saved to
  `/etc/locale.gen', which you can also edit manually (you need to run
  `locale-gen' afterwards).
+ .
+ UTF-8 locales are recommended.  Locales using old national character sets
+ are provided for backwards-compatibility, but should not be used unless
+ strictly required.
 
 Template: locales/default_environment_locale
 Type: select


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (990, 'unstable')
Architecture: powerpc (ppc)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12-rc6
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)



Reply to: