Bash-4.3 distribution sources and documentation
[platform/upstream/bash.git] / tests / intl.tests
1 export LC_ALL=en_US.UTF-8
2
3 a=$'\303\251'
4
5 echo "$a"
6
7 echo ${#a}
8
9 b=$'A\303\251B'
10
11 echo "$b"
12
13 echo ${b: -1}
14
15 c=AeB
16
17 echo ${c: -1}
18
19 unset a
20 a=$(printf '%b' 'A\303\251B')
21 IFS=$(printf '%b' '\303\251')
22
23 case "$a" in
24 "A${IFS}B")     echo ok 1 ;;
25 *)              echo bad 1 ;;
26 esac
27
28 set $a
29
30 case $1 in
31 A)              echo ok 2 ;;
32 *)              echo bad 2 ;;
33 esac
34
35 set a b
36
37 printf '%s\n' "$*"
38 # squeeze out blanks to avoid white space differences in od implementations
39 printf '%s' "$*" | od -b | ( IFS=$' \t\n' ;  while read line; do echo $line; done; )
40
41 # display differences make this problematic
42 ${THIS_SH} ./intl1.sub
43
44 # this tests both international handling in printf and temporary environments
45 ${THIS_SH} ./intl2.sub
46
47 ${THIS_SH} ./unicode1.sub 2>/dev/null
48 ${THIS_SH} ./unicode2.sub
49
50 ${THIS_SH} ./unicode3.sub 2>&1