From 6fc33415801afe751994fb4fba29fad7561f3bee Mon Sep 17 00:00:00 2001 From: Patrice FERLET Date: Thu, 11 Jun 2015 01:03:55 +0200 Subject: [PATCH] Appended utf8 ASCIIMODE Thanks to "normando" for its issue and to cverbi for autodetection Fixes #11 --- simple_curses.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/simple_curses.sh b/simple_curses.sh index 18da61e..77c53ae 100644 --- a/simple_curses.sh +++ b/simple_curses.sh @@ -84,7 +84,9 @@ _SEPL="\033(0t\033(B" _SEPR="\033(0u\033(B" _VLINE="\033(0x\033(B" _HLINE="\033(0q\033(B" -init_chars(){ + +init_chars(){ + if [[ -z "$ASCIIMODE" && $LANG =~ ".*\.UTF-8" ]] ; then ASCIIMODE=utf8; fi if [[ "$ASCIIMODE" != "" ]]; then if [[ "$ASCIIMODE" == "ascii" ]]; then _TL="+" @@ -96,9 +98,20 @@ init_chars(){ _VLINE="|" _HLINE="-" fi + if [[ "$ASCIIMODE" == "utf8" ]]; then + _TL="\xE2\x94\x8C" + _TR="\xE2\x94\x90" + _BL="\xE2\x94\x94" + _BR="\xE2\x94\x98" + _SEPL="\xE2\x94\x9C" + _SEPR="\xE2\x94\xA4" + _VLINE="\xE2\x94\x82" + _HLINE="\xE2\x94\x80" + fi fi } + #Append a windo on POSX,POSY window(){ LASTWINPOS=$POSY