Adjust date specification and subject encoding
authorJoey Schulze <joey@infodrom.org>
Thu, 26 Nov 2009 20:50:26 +0000 (20:50 +0000)
committerJoey Schulze <joey@infodrom.org>
Thu, 26 Nov 2009 20:50:26 +0000 (20:50 +0000)
mail-calendar

index e77c67c..e633ed2 100755 (executable)
@@ -80,13 +80,13 @@ esac
 
 secs=$[ $opt_advance * 86400 ]
 
-c_date=`date -d now+${secs}seconds +%d.%m`
-s_date=`LANG=$opt_lang date -d now+${secs}seconds "+$opt_dateform"|iconv -f utf8 -t iso8859-1`
+c_date=`date -d now+${secs}seconds +%m%d`
+s_date=`LANG=$opt_lang date -d now+${secs}seconds "+$opt_dateform"`
 
 tmp=`tempfile`
 trap 'rm -f $tmp' INT EXIT
 
-calendar -l 0 -w 0 -t $c_date|iconv -c -f utf8 -t iso8859-1 > $tmp
+LC_CTYPE=en_US.ISO-8859-1 calendar -l 0 -w 0 -t $c_date|iconv -c -f utf8 -t iso8859-1 > $tmp
 
 if [ -s $tmp ]
 then
@@ -98,5 +98,5 @@ then
        echo "Content-Transfer-Encoding: 8bit"
        echo
        cat $tmp
-    ) | /usr/sbin/sendmail "$opt_to"
+    ) | LANG=$opt_lang /usr/sbin/sendmail "$opt_to"
 fi