From d5edcef1df9356b37e7a19c6d0f401298df9c3d5 Mon Sep 17 00:00:00 2001 From: Andreas Brachold Date: Sat, 4 Jul 2009 16:42:30 +0000 Subject: * add automated detect for environment with UTF-8 ('export LANG=de_DE.utf8; xxvd'), remove xxvd option --utf8 --- bin/xxvd | 11 +++++++---- doc/CHANGELOG | 2 +- doc/xxvd.1 | 9 +++------ doc/xxvd.sgml | 11 ++--------- 4 files changed, 13 insertions(+), 20 deletions(-) diff --git a/bin/xxvd b/bin/xxvd index 2403533..3a8d6e9 100755 --- a/bin/xxvd +++ b/bin/xxvd @@ -92,7 +92,6 @@ GetOptions ( "newstmpl=s" => \$PATHS->{NEWSTMPL}, "xmltv=s" => \$PATHS->{XMLTV}, "verbose=s" => \$verbose, # debug output level - "utf8" => \$useutf8, # Use encoding utf8 as data charset. "version" => \$version, # print version "nofork" => \$nofork, # switch fork off, for better debugging "kill" => \$killer, # kill old xxvd @@ -137,7 +136,7 @@ unless($nofork) { } } -setlocale (LC_ALL, ''); #From environment like 'export LANG="fr_FR"' +my $current_locale = setlocale (LC_ALL, ''); #From environment like 'export LANG="fr_FR"' # Load a config my $CFGOBJ = Config::Tiny->new(); @@ -148,6 +147,10 @@ unless($Config){ exit(1); } +# Check for environment with UTF-8 +$useutf8 = 1 if($current_locale && + ($current_locale =~ /UTF.+8/sig + || $current_locale =~ /utf8/sig)); # Install i18n system $charset = &init_locale($Config, $PATHS, $useutf8); @@ -162,6 +165,8 @@ if($cfgUsrFile ne $cfgFile) { debug sprintf('Use configuration file "%s"', $cfgUsrFile); } +debug sprintf("Used database charset '%s'", $charset); + # Check templateModul &init_template($TEMPLMOD); @@ -487,8 +492,6 @@ sub init_locale { my $useutf8 = shift; my $charset; - # use I18N::Langinfo qw(langinfo CODESET); - # $charset = langinfo(CODESET); if($useutf8){ $charset = 'UTF-8'; eval 'use utf8'; diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 087c51b..8eb7f78 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -15,7 +15,7 @@ New features: * New module to manage keywords within recordings * New import module for XML-TV sources and template for scheme based programs. New commands xn (new) xe (edit) xd (delete) xl (list) xt (manual update) -* UTF8 Support. Run 'xxvd --utf8' to use encoding utf8 as data char set. +* UTF8 Support. Run 'export LANG="de_DE.utf8"; ./xxvd' to use encoding utf8 as data char set. Common changes: * Log referrer to wrong filename, if database version mismatch diff --git a/doc/xxvd.1 b/doc/xxvd.1 index b484926..1be01f8 100644 --- a/doc/xxvd.1 +++ b/doc/xxvd.1 @@ -5,7 +5,7 @@ \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac -.TH xxvd 1 "March 08, 2008" "" "" +.TH xxvd 1 "July 04, 2009" "" "" .SH NAME XXV \- means "Xtreme eXtension for VDR" and is a central service for the administration of the VDR and his environment. .SH SYNOPSIS @@ -15,7 +15,7 @@ XXV \- means "Xtreme eXtension for VDR" and is a central service for the adminis \fBxxvd\fR \kx .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 'in \n(.iu+\nxu -[\fB--configfile=\fR \fIFILE\fR] [\fB--logfile=\fR \fIFILE\fR] [\fB--pidfile=\fR \fIFILE\fR] [\fB--localedir=\fR \fIDIRECTORY\fR] [\fB--moduledir=\fR \fIDIRECTORY\fR] [\fB--docudir=\fR \fIDIRECTORY\fR] [\fB--poddir=\fR \fIDIRECTORY\fR] [\fB--htmldir=\fR \fIDIRECTORY\fR] [\fB--fontdir=\fR \fIDIRECTORY\fR] [\fB--newsmods=\fR \fIDIRECTORY\fR] [\fB--newstmpl=\fR \fIDIRECTORY\fR] [\fB--xmltv=\fR \fIDIRECTORY\fR] [\fB--verbose=\fR \fILEVEL\fR] [\fB--utf8\fR] [\fB--version\fR] [\fB--nofork\fR] [\fB--kill\fR] +[\fB--configfile=\fR \fIFILE\fR] [\fB--logfile=\fR \fIFILE\fR] [\fB--pidfile=\fR \fIFILE\fR] [\fB--localedir=\fR \fIDIRECTORY\fR] [\fB--moduledir=\fR \fIDIRECTORY\fR] [\fB--docudir=\fR \fIDIRECTORY\fR] [\fB--poddir=\fR \fIDIRECTORY\fR] [\fB--htmldir=\fR \fIDIRECTORY\fR] [\fB--fontdir=\fR \fIDIRECTORY\fR] [\fB--newsmods=\fR \fIDIRECTORY\fR] [\fB--newstmpl=\fR \fIDIRECTORY\fR] [\fB--xmltv=\fR \fIDIRECTORY\fR] [\fB--verbose=\fR \fILEVEL\fR] [\fB--version\fR] [\fB--nofork\fR] [\fB--kill\fR] 'in \n(.iu-\nxu .ad b 'hy @@ -96,9 +96,6 @@ messages of XXV. >5 - Messages with dump of caller stack .RE .TP ---utf8 -Use encoding utf8 as data charset. -.TP --version Display the version number and exit. .TP @@ -110,4 +107,4 @@ Kill daemon \fBxxvd\fR. .SH AUTHOR This manual page was written by Tobias Grimm <<\*(T>>. .PP -(March 08, 2008) +(July 04, 2009) diff --git a/doc/xxvd.sgml b/doc/xxvd.sgml index c60401a..cb1a656 100644 --- a/doc/xxvd.sgml +++ b/doc/xxvd.sgml @@ -4,7 +4,7 @@ [ Tobias"> Grimm"> - + &date;"> 1"> tg@e-tobi.net"> @@ -23,7 +23,7 @@
&dhemail;
&dhfirstname; &dhsurname; - 2005 - 2008 + 2005 - 2009 &dhusername; &dhdate; @@ -50,7 +50,6 @@ DIRECTORY DIRECTORY LEVEL - @@ -168,12 +167,6 @@ - - --utf8 - - Use encoding utf8 as data charset. - - --version -- cgit v1.2.3