#!/bin/sh
#
# This is a wrapper script that tests the locale and executes the
# appropriate version of rxvt.

if   [ "$LC_ALL"   = "zh_TW.Big5"   ]; then ext=big5
elif [ "$LC_ALL"   = "zh_CN.GB2312" ]; then ext=gb
elif [ "$LC_CTYPE" = "zh_TW.Big5"   ]; then ext=big5
elif [ "$LC_CTYPE" = "zh_CN.GB2312" ]; then ext=gb
elif [ "$LANG"     = "zh_TW.Big5"   ]; then ext=big5
elif [ "$LANG"     = "zh_CN.GB2312" ]; then ext=gb
else ext=big5
fi
exec /usr/bin/crxvt-"$ext" "$@"
