Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 15 Sep 2014, 00:15
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Displaying text correctly in the terminal (no X)
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [2 Posts]  
Author Message
d2390576

Joined: 30 Oct 2012
Posts: 1

PostPosted: Tue 30 Oct 2012, 19:03    Post subject:  Displaying text correctly in the terminal (no X)  

I like to do a lot of ebook reading with txt files on my laptop. Usually when I boot up, I don't bother loading X if all I'm going to do is read. I notice that some text files display punctuation incorrectly in vi, mp, and using the less command. I've tried switching encoding using Geany and even Abiword to US ASCII, UTF-8, and others with no effect.

However, starting X and displaying the text files in Geany, Leafpad, or Abiword makes them display correctly. I've also tried viewing the files from the commandline in another distro (SLAX) but they are also corrupted there, which makes me think this is unique to Linux. Does anyone have any experience with this?
punctuation_errors.png
Description  Showing the difference between how Geany displays quotes and Vi
png

 Download 
Filename  punctuation_errors.png 
Filesize  153.2 KB 
Downloaded  268 Time(s) 
Back to top
View user's profile Send private message 
npierce

Joined: 28 Dec 2009
Posts: 858

PostPosted: Thu 01 Nov 2012, 16:07    Post subject:  

Hi d2390576,

Welcome to the forum.

As someone who also spends a fair bit of time in the text console, I can certainly appreciate your desire to have text displayed properly.

By providing the output from vi, you have shown that the pg108.txt file doesn't use an ASCII quotation mark (unless your version of vi or your font is seriously broken, which is unlikely). The dot is what is displayed for an unsupported character.

In order to determine what is going wrong, we first need to find what code the text file is using for a quotation mark. Other common codes for quotation marks are Unicode U+201C and U+201D (which would be encoded in a UTF-8 text file as three-byte sequences: "\xe2\x80\x9c" and "\xe2\x80\x9d"), and Windows-1252 character codes '\x93' and '\x94'. But those codes are all for separate opening and closing quotation marks, yet you show that Geany only displays a neutral quotation mark, so I'm guessing it is something else. Also, if it was UTF-8, I would expect to see three dots (one for each byte).

So it's a bit of a mystery. I downloaded three different versions of The Adventure Of The Empty House from Project Gutenberg, but all had standard ASCII quotation marks. I didn't find the version that you have.

Let's have a look at your file. Please go to the directory with the text file, run this command:
Code:
tail -n +227  pg108.txt | head -n 2 | hexdump -C

and post the results. It should provide output similar to this (except the values for the quotation marks will be different):
Code:
00000000  22 59 6f 75 27 72 65 20  73 75 72 70 72 69 73 65  |"You're surprise|
00000010  64 20 74 6f 20 73 65 65  20 6d 65 2c 20 73 69 72  |d to see me, sir|
00000020  2c 22 20 73 61 69 64 20  68 65 2c 20 69 6e 20 61  |," said he, in a|
00000030  20 73 74 72 61 6e 67 65  2c 20 63 72 6f 61 6b 69  | strange, croaki|
00000040  6e 67 0d 0a 76 6f 69 63  65 2e 0d 0a              |ng..voice...|
0000004c

Alternately (or additionally) if you remember where you got the file, you could provide a link to it.

Also, it never hurts to mention the version of Puppy that you are using, which will help others when trying to reproduce the behavior you are seeing.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [2 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0633s ][ Queries: 13 (0.0212s) ][ GZIP on ]