LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions
User Name
Password
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.

Notices


Reply
  Search this Thread
Old 12-03-2013, 02:46 PM   #1
ThreeNine
LQ Newbie
 
Registered: Nov 2013
Posts: 19

Rep: Reputation: Disabled
Line Drawing Chars in TinyCore Linux


Hi all,

I'm trying to run a script that I wrote and it works fine, but the line drawing characters that I used to make it look nice don't work under tiny core. I tested it under lucid puppy and debian (actually, raspbian) while writing it and they looked fine. Here's a cut of the code I'm using.

Code:
echo "┌───────────Menu:──────────────┐"
echo "│ Enter 1: Simple Install      │"
echo "│ Enter 2: Full Install        │"
echo "│ Enter 3: Simple Uninstall    │"
echo "│ Enter 4: Thorough Uninstall  │"
echo "│ Enter q to quit to terminal  │"
echo "│ Enter r to reboot            │"
echo "└──────────────────────────────┘
As you can see, it looks fine here, but in Tiny Core it looks garbled (see attachment). I know that Tiny Core is tiny, so if I need to change the characters that's fine, I just need to know what to use. Also, it needs to work the same in CLI only mode.

I should mention, I'm running TinyCore from VMware, so if that's a problem let me know. I feel like it's probably not the problem.

Edit: I should also mention that I had to install bash for this to run.

Edit again: This script printed the characters I need... now to just put them in the proper place:
char=( 6a 6b 6c 6d 6e 71 74 75 76 77 78 )
for i in ${char[*]}; do printf "0x$i \x$i \e(0\x$i\e(B\n"; done
Attached Thumbnails
Click image for larger version

Name:	cerba on tiny core.png
Views:	40
Size:	70.0 KB
ID:	14124  

Last edited by ThreeNine; 12-03-2013 at 03:31 PM.
 
Old 12-04-2013, 11:54 AM   #2
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Salix
Posts: 6,259

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
It looks like TinyCore is not set for Unicode. You need en_GB.utf8 or en_US.utf8 for the language locale. What does "locale" show?
 
Old 12-04-2013, 01:40 PM   #3
ThreeNine
LQ Newbie
 
Registered: Nov 2013
Posts: 19

Original Poster
Rep: Reputation: Disabled
locale reports:

LANG=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=



so... "C" is the local I guess.
 
Old 12-04-2013, 08:37 PM   #4
ThreeNine
LQ Newbie
 
Registered: Nov 2013
Posts: 19

Original Poster
Rep: Reputation: Disabled
Here is the fix I used, for those interested:
Code:
echo -e "\e(0lqqqqqqqqqqq\e(BMenu:\e(0qqqqqqqqqqqqqqqqk\e(B"
echo -e "\e(0x\e(B Enter 1: Simple Install        \e(0x\e(B"
echo -e "\e(0x\e(B Enter 2: Full Install          \e(0x\e(B"
echo -e "\e(0x\e(B Enter 3: Simple Uninstall      \e(0x\e(B"
echo -e "\e(0x\e(B Enter 4: Thorough Uninstall    \e(0x\e(B"
echo -e "\e(0x\e(B Enter q: to quit to terminal   \e(0x\e(B"
echo -e "\e(0x\e(B Enter r: to reboot             \e(0x\e(B"
echo -e "\e(0mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj\e(B"
It uses escape characters to print the desired character.

Last edited by ThreeNine; 12-04-2013 at 09:40 PM.
 
Old 12-04-2013, 09:21 PM   #5
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
Hi

its not quite true that TC lacks UTF8 or unicode support rather you appear to be running aterm which lacks such support as per

http://forum.tinycorelinux.net/index.php?topic=14351.0

and note I claim lilyterm is OK

but I am no longer am a member of that forum and lilyterm is not in the 5.x series
http://tinycorelinux.net/5.x/x86/tcz/

you could join the forum, if interested and make a request for lilyterm to be built for 5x series
or stay with your work-a-round

alternatively you could import it into 5x and test it and report it works or if it fails
compile it yourself and submit it

good luck

Its also a good idea to join that forum so you can cross post for maximum benefits or solutions.

Last edited by aus9; 12-04-2013 at 09:24 PM.
 
Old 12-04-2013, 09:43 PM   #6
ThreeNine
LQ Newbie
 
Registered: Nov 2013
Posts: 19

Original Poster
Rep: Reputation: Disabled
Hi aus9,

Interesting point. I was planning on having this run from the CLI and not a terminal inside the GUI. As it happens, I haven't tested it in this way yet. Perhaps I "assumed" that what would not print in aterm, would not print in the GUI.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
head adds chars to end of each line (Red Hat Enterprise Linux) CheckiSt Linux - General 13 04-14-2010 03:52 AM
Script to count # of chars per line (if line meets certain criteria) and get avg #? kmkocot Linux - Newbie 3 09-13-2009 11:05 AM
how many chars can be displayed in a line? williamjxj Linux - Software 1 10-25-2004 03:24 AM
Drawing a line chr15t0 Linux - General 1 03-27-2003 03:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions

All times are GMT -5. The time now is 09:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration