--- xdg-email	2011-01-01 11:03:14.000000000 +0100
+++ xdg-email.new	2014-08-20 15:11:22.000000000 +0200
@@ -360,7 +360,7 @@
     elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
     elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome;
     elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
-    elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde;
+    elif [ x"$DESKTOP_SESSION" = x"LXDE" ]; then DE=lxde;
     else DE=""
     fi
 }
@@ -533,7 +533,7 @@
 
 url_encode()
 {
-result=$(echo "$1" | $utf8 | awk '
+result=$(echo "$1" | $utf8 | LC_ALL=POSIX awk '
     BEGIN {
         for ( i=1; i<=255; ++i ) ord [ sprintf ("%c", i) "" ] = i + 0
         e = ""
@@ -547,7 +547,7 @@
             c = substr ($0, i, 1)
             if ( ord [c] > 127 ) {
                 e = e "%" sprintf("%02X", ord [c])
-            } else if ( c ~ /[@a-zA-Z0-9.-\\\/]/ ) {
+            } else if ( c ~ /[@a-zA-Z0-9.\-\\\/]/ ) {
                 e = e c
             } else {
                 e = e "%" sprintf("%02X", ord [c])
