summaryrefslogtreecommitdiff
path: root/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox6-utf8
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox6-utf8')
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/inputbox6-utf836
1 files changed, 36 insertions, 0 deletions
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox6-utf8 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox6-utf8
new file mode 100755
index 00000000000..2a8d6c33e81
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox6-utf8
@@ -0,0 +1,36 @@
+#!/bin/sh
+# $Id: inputbox6-utf8,v 1.2 2008/03/16 13:58:54 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+case none"$LANG$LC_ALL$LC_CTYPE" in
+*UTF-8*)
+ ;;
+*)
+ echo "This script must be run in a UTF-8 locale"
+ exit 1
+ ;;
+esac
+
+$DIALOG \
+--title `printf "\xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\xe3\x81\x8a"` \
+--inputbox `printf "\xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\xe3\x81\x8a"` \
+10 20 "D.O.G" 2>$tempfile
+
+retval=$?
+
+case $retval in
+ 0)
+ echo "Input string is \"`cat $tempfile`\"";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ if test -s $tempfile ; then
+ cat $tempfile
+ else
+ echo "ESC pressed."
+ fi
+ ;;
+esac