On Fri, Aug 18, 2006 at 09:36:59PM +0200, Ola Lundqvist wrote:
> Hi
> 
> Thanks for the suggestions.
> 
> You are perfectly right.
> 
> Do you have a full patch file with something that works for you?

Yes, the attached .diff was tested on current etch host/guest with
both cs_CZ.UTF8 UTF-8 locale and the older cs_CZ ISO-8859-2 locale.

-- 
Miroslav Kure
--- newvserver.old      2006-07-18 00:54:00.000000000 +0200
+++ newvserver  2006-08-18 21:59:06.000000000 +0200
@@ -401,9 +401,9 @@
 # Create a locale.gen if needed.
 if [ -n "$LANG" ] && [ "$LANG" != "C" ] ; then
     if [ ! -e "$VROOTDIR/$VHOST/etc/locale.gen" ] ; then
-       echo $LANG > "$VROOTDIR/$VHOST/etc/locale.gen"
+       echo $LANG $(locale charmap) > "$VROOTDIR/$VHOST/etc/locale.gen"
     elif ! grep $LANG "$VROOTDIR/$VHOST/etc/locale.gen" > /dev/null ; then
-       echo $LANG >> "$VROOTDIR/$VHOST/etc/locale.gen"
+       echo $LANG $(locale charmap) >> "$VROOTDIR/$VHOST/etc/locale.gen"
     fi
 fi
 
@@ -536,6 +536,8 @@
 cat << EOF > "$VROOTDIR/$VHOST/vserver-config.sh"
 #!/bin/sh
 
+[ -x /usr/sbin/locale-gen ] && /usr/sbin/locale-gen
+
 dselect update
 
 tzsetup -y

Reply via email to