W. H. Heydt
Posts: 12045
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: How To Get Mousepad To Read Standard Text Files

Fri Mar 06, 2020 5:42 am

emma1997 wrote:
Thu Mar 05, 2020 7:47 pm
P.S. vi wasn't locking up my Pi after all. It wasn't obvious to include a filename without which everything just seems dead.
Odd... I just ran vi without an argument and got a screen giving a couple of basic commands. Perhaps I should note that when you start it that way, unless you're planning to create a new file, the next thing you'd do would be...

Code: Select all

:r <filename>
...and that will read in the file you want to edit..

And for those that have said that vi isn't for beginners, while I wouldn't argue otherwise, there are plenty of people for whom vi was the very first editor they used, so it *can* be for beginners. (Mind you, I learned the rudiments of vi about 40 years ago on a bsd 2.9 system actually run by UC Berkeley, where it was written, using an ADM-3A terminal, which was the original terminal it was written for--before TERMCAP--complete with arrows on the hjkl keys.)

jahboater
Posts: 5441
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: How To Get Mousepad To Read Standard Text Files

Fri Mar 06, 2020 9:35 am

scruss wrote:
Fri Mar 06, 2020 4:10 am
Emacs handles CRLFs fairly gracefully without conversion.
Yes, last time I had to use Windows/Linux/MAC's in combination I had zero problems using emacs.

For amusement: early MAC's used LFCR !!!!!! crazy, but they eventually made the sensible change to LF only.
scruss wrote:
Fri Mar 06, 2020 4:10 am
Personally, I'd use a dos2unix / iconv / edit / iconv / unix2dos chain to edit the files.
I use a home written text editor designed for coding. As such, it deletes trailing white space on input. CR is white space, so it transparently works with Windows files with no special code.
emma1997 wrote:
Thu Mar 05, 2020 7:47 pm
Anyway, after much trial and tribulation (had to backup and resize some partitions again), Leafpad is up and running and fixes the problem. I had no idea it would be that easy. Not perfect because it will be necessary to send cards out to my sister and pals who don't have easy internet but thanks to those instructions on offline loading should only have to do that one time and easy to instruct over the phone.
Glad its solved!
"We are in the beginning of a mass extinction, and all you can talk
about is money and fairy tales of eternal economic growth."
- Greta Thunberg

W. H. Heydt
Posts: 12045
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: How To Get Mousepad To Read Standard Text Files

Fri Mar 06, 2020 4:07 pm

jahboater wrote:
Fri Mar 06, 2020 9:35 am
scruss wrote:
Fri Mar 06, 2020 4:10 am
Emacs handles CRLFs fairly gracefully without conversion.
Yes, last time I had to use Windows/Linux/MAC's in combination I had zero problems using emacs.
If it comes to that...I've found that LibreOffice on Windows has no problem with Linux text files.

emma1997
Posts: 710
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: How To Get Mousepad To Read Standard Text Files

Sat Mar 07, 2020 12:19 am

scruss wrote:
Fri Mar 06, 2020 4:10 am
Using ISO-8859-* character sets in 2020 is a bit quaint. 8859-14 is pretty niche, and entirely covered by UTF-8. It's been at least a decade since 8-bit chars were the norm.
We'll have to agree to disagree on that. After spending couple weeks scanning several thousand text files on hard disk and from internet it seems vast majority contained 8-bit (AKA Extended ASCII Character Set). For example your post would not have been possible using 7 bit chars.
scruss wrote:
Fri Mar 06, 2020 4:10 am
And you're using the Compose key to generate characters like ŵ, right?
AFAIK I haven't actually ever used an extended character myself out of thousands of text files created last few decades (mostly code, work orders, docs). It's primarily stuff collected elsewhere over the years that had it. And new stuff downloaded from forums and websites. It's getting worse, not better, IMO.
andrum99 wrote:
Fri Mar 06, 2020 2:57 am
the switch was made because Mousepad has a simpler UI than Leafpad.
Not a valid assumption I think. After spending couple days with both I'm convinced it's the other way around. Mousepad is considerably more ergonomic in regards to friendly (IE Windows) cursor behavior and about 4x more options and 'features' (at least one too many in this case, lol).

The Universe is expanding and unfortunately so is most of the software being produced these days.

In my case that startup fuss was the major problem so it's Leafpad for most reading but keeping Mousepad online where heavy editing is involved. In the long run a manageable solution and big improvement over the way it was for what I do.

I am curious if Mousepad source code is available and conceivable to get involved with compiling again. Not something I would look forward to ATM.

User avatar
TheMindVirus
Posts: 151
Joined: Mon Jul 29, 2019 12:38 am
Location: Cornwall, UK

Re: How To Get Mousepad To Read Standard Text Files

Sat Mar 07, 2020 12:32 am

Everything's on GitHub these days: https://github.com/xfce-mirror/mousepad
It's had at least 20 releases but hasn't reached 1.0.0 yet. Leafpad is probably a better bet at the moment.
Alastair Cota
Embedded Firmware Developer
[ERR]: Sense of Humour Failure

emma1997
Posts: 710
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: How To Get Mousepad To Read Standard Text Files

Sat Mar 07, 2020 12:43 am

Wow... so there's hope the brainiac behind that 'feature' will come to his senses and might produce a working copy some day. An option in preferences to turn off that startup nag would be great.

I see two warring factions inside the Linux community: the 'Anything But MS' (D&D) crowd who think EVERYTHING in life should be an adventure game and the 'Gotta Git 'er Done' guys who may have actually taken a class or two in ergonomics.

Fortunately the Pi people seem to gravitate from that latter. I was strictly a Linux appliance user until recently being tricked into taking another look at inner workings by helpful forum members. Hopefully they will persist in treating Pi at kindergarden level because that's just about where I'm at. lol

User avatar
scruss
Posts: 3069
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: How To Get Mousepad To Read Standard Text Files

Sat Mar 07, 2020 4:50 am

emma1997 wrote:
Sat Mar 07, 2020 12:19 am
For example your post would not have been possible using 7 bit chars.
When I said 8-bit chars, I meant character sets limited to 8 bits. UTF-8 is just a clever way of mapping far wider characters onto a few bytes.

I'm also suspecting you meant ISO 8859-15 instead of 14, too.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

emma1997
Posts: 710
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: How To Get Mousepad To Read Standard Text Files

Sat Mar 07, 2020 5:33 am

scruss wrote:
Sat Mar 07, 2020 4:50 am
emma1997 wrote:
Sat Mar 07, 2020 12:19 am
For example your post would not have been possible using 7 bit chars.
When I said 8-bit chars, I meant character sets limited to 8 bits. UTF-8 is just a clever way of mapping far wider characters onto a few bytes.

I'm also suspecting you meant ISO 8859-15 instead of 14, too.
Yes, everything went to heck in a handbasket after 7 bit paper tape. I don't even bother to keep up anymore. I still get nightmares over PDP8 12bit instruction set.

BTW if you run Mousepad with one of those 'bad' characters the default click through choice is -14 not -15. Maybe there's others buried in there that also work but I've got limited time to experiment. Leafpad's doing the trick for now.

User avatar
scruss
Posts: 3069
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: How To Get Mousepad To Read Standard Text Files

Sun Mar 08, 2020 4:39 pm

I guess you must be running an unusual locale, then. I usually add an 8859-15 locale as a fallback (Raspbian doesn't by default) but set my regular locale to a UTF-8 one.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

User avatar
PeterO
Posts: 5729
Joined: Sun Jul 22, 2012 4:14 pm

Re: How To Get Mousepad To Read Standard Text Files

Sun Mar 08, 2020 4:46 pm

emma1997 wrote:
Sat Mar 07, 2020 5:33 am
Yes, everything went to heck in a handbasket after 7 bit paper tape.
PAH !
https://www.youtube.com/watch?v=AIxZ1i8pvZI
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
Paeryn
Posts: 2904
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: How To Get Mousepad To Read Standard Text Files

Mon Mar 09, 2020 12:14 am

emma1997 wrote:
Sat Mar 07, 2020 5:33 am
BTW if you run Mousepad with one of those 'bad' characters the default click through choice is -14 not -15. Maybe there's others buried in there that also work but I've got limited time to experiment. Leafpad's doing the trick for now.
AFAIK the list of encodings to choose from is just a list of the possible encodings that produce valid UTF-8 when the file is converted (the list it checks against has about 62 encodings). The default is just the first which succeeded (the very first encoding it checks is ISO-8859-14), mousepad has no way of knowing which encoding is the correct one, nor any way of sorting the list according to likelihood.
She who travels light — forgot something.

emma1997
Posts: 710
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: How To Get Mousepad To Read Standard Text Files

Mon Mar 09, 2020 8:21 pm

scruss wrote:
Sun Mar 08, 2020 4:39 pm
I guess you must be running an unusual locale, then. I usually add an 8859-15 locale as a fallback (Raspbian doesn't by default) but set my regular locale to a UTF-8 one.
I must admit, even after search, it's not obvious what 'locale' really means in Pi world. I just entered US/English/NY to all the install questions. My /etc/default/locale is all UFT-8.

Is there a way to fix this issue by replacing UTF-8 there with ISO-8859-14 or by changing locale? I'd gladly move to Ross Island or someplace in Zimbabwe to get Mousepad working.

User avatar
scruss
Posts: 3069
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: How To Get Mousepad To Read Standard Text Files

Mon Mar 09, 2020 9:13 pm

sudo raspi-config
4 Localisation Options → I1 Change Locale → add en_US ISO-8859-1 and en_US.ISO-8859-15 AND IF YOU REALLY MUST cy_GB as it will give you ISO-8859-14 (keeping en_US.UTF-8): hit okay
Keep Default locale as en_US.UTF-8: hit okay
The system will go off Generating locales (this might take a while)...
You'll find that /etc/default/locale stays the same

Locales are all the language-specific things that we all expect as default: character sets, collation orders, etc. And they are all so very very different in different countries. And that is good and right.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

emma1997
Posts: 710
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: How To Get Mousepad To Read Standard Text Files

Mon Mar 09, 2020 10:18 pm

lol. Even normally well behaved Notepad threw a fit with that post!

I'm still not completely sure what it all means but thanks for helping to clear this up. If you think that might suppress the error I'll give it a try when I get access.

User avatar
scruss
Posts: 3069
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: How To Get Mousepad To Read Standard Text Files

Tue Mar 10, 2020 1:56 am

If your text handling tools are losing it over simple UTF-8 entities like ‘→’, there's something wrong with your Linux setup that we don't have information to fix. It displays perfectly in leafpad on Raspbian.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

Lewis-H
Posts: 26
Joined: Thu Oct 31, 2019 12:45 pm

Re: How To Get Mousepad To Read Standard Text Files

Tue Mar 10, 2020 9:58 am

In XFCE, it is pretty easy to change a file associate at any time. Right-click the file and select "Properties". The third tab at the end is "Open With". Select "open with" and select your preferred application, then at the bottom select "Set as Default." From then on, when you click to open the file, it will open with that application.
I hope this helps and thanks for the very informative post.

emma1997
Posts: 710
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: How To Get Mousepad To Read Standard Text Files

Tue Mar 10, 2020 8:08 pm

Yes, I have recently noticed those options popping up when dragging the mouse around but didn't quite appreciate the possibilities. When time allows some experimentation may be in order. This may be a final solution. Thanks for bringing that up.
scruss wrote:
Tue Mar 10, 2020 1:56 am
If your text handling tools are losing it over simple UTF-8 entities like ‘→’, there's something wrong with your Linux setup
BTW the Notepad mentioned in my post is Winders not Linux. It don't actually complain about Unicode chars until you try to save and then just removes them. Much less annoying than Mousepad's startup drama. In fact I like it as a notification (similar to the way nixies need to be warned they are dealing with that evil regular text. lol).

Now that the root problem is more or less fixed I can investigate some of the alternatives to trick Mousepad into behaving so it won't be necessary to keep two editors around.

User avatar
scruss
Posts: 3069
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: How To Get Mousepad To Read Standard Text Files

Wed Mar 11, 2020 2:14 pm

Windows 10 Notepad reads and saves UTF-8 just fine … you should have said you were using Windows. Some older versions of Windows used UTF-16, which made your text ␀l␀o␀o␀k␀ ␀l␀i␀k␀e␀ ␀t␀h␀i␀s for everyone else.
May I suggest Notepad++ on Windows instead? It has a better idea of what "standard" means.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

ganzgustav22
Posts: 44
Joined: Tue Feb 11, 2020 1:04 pm

Re: How To Get Mousepad To Read Standard Text Files

Wed Mar 11, 2020 2:50 pm

This thread is a perfect example of what is wrong with open source. It also explains the sad state of "Linux ready for the desktop". I'm still waiting for that to happen. Have been waiting now for 20 years.

Simple things like opening a textfile with the standard text editor doesn't work without jumping through whatever hoops.

And _of course_ the usual arguments. It's Microsofts fault, you're doing it wrong, 50 years ago people used vi and where happy with 7bit ascii, 75 years ago they were happy punching holes in cards, set some environment variable here and there, re-configure your locale settings, use this and that trick and workaround, emacs is better anyways, your textfile is broken, it totally has to be like this because yadda yadda (while all other editors just work ...).

I think we didn't have "it's open source, if you don't like it, why don't you fix it yourself" yet.

User avatar
PeterO
Posts: 5729
Joined: Sun Jul 22, 2012 4:14 pm

Re: How To Get Mousepad To Read Standard Text Files

Wed Mar 11, 2020 3:00 pm

ganzgustav22 wrote:
Wed Mar 11, 2020 2:50 pm
This thread is a perfect example of what is wrong with open source. It also explains the sad state of "Linux ready for the desktop". I'm still waiting for that to happen. Have been waiting now for 20 years.

Simple things like opening a textfile with the standard text editor doesn't work without jumping through whatever hoops.

And _of course_ the usual arguments. It's Microsofts fault, you're doing it wrong, 50 years ago people used vi and where happy with 7bit ascii, 75 years ago they were happy punching holes in cards, set some environment variable here and there, re-configure your locale settings, use this and that trick and workaround, emacs is better anyways, your textfile is broken, it totally has to be like this because yadda yadda (while all other editors just work ...).

I think we didn't have "it's open source, if you don't like it, why don't you fix it yourself" yet.
It has nothing at all to do with open source. It's about character sets and encoding standards.

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

Heater
Posts: 15444
Joined: Tue Jul 17, 2012 3:02 pm

Re: How To Get Mousepad To Read Standard Text Files

Wed Mar 11, 2020 3:26 pm

ganzgustav22 wrote:
Wed Mar 11, 2020 2:50 pm
This thread is a perfect example of what is wrong with open source. It also explains the sad state of "Linux ready for the desktop". I'm still waiting for that to happen. Have been waiting now for 20 years.

Simple things like opening a textfile with the standard text editor doesn't work without jumping through whatever hoops.

And _of course_ the usual arguments. It's Microsofts fault, you're doing it wrong, 50 years ago people used vi and where happy with 7bit ascii, 75 years ago they were happy punching holes in cards, set some environment variable here and there, re-configure your locale settings, use this and that trick and workaround, emacs is better anyways, your textfile is broken, it totally has to be like this because yadda yadda (while all other editors just work ...).

I think we didn't have "it's open source, if you don't like it, why don't you fix it yourself" yet.
Your post is an example of ignorance and something not quite right.

The issue here is good old fashioned text file formats. You should know that they come in many different flavors depending on language a character set in use. The question here specifically states "iso-8859-14". Otherwise known as Latin-8 or Celtic it is a character encoding for Celtic languages, such as Irish, Manx, Scottish Gaelic, Welsh, Cornish, and Breton. It was originally designed for the Sami language. Perhaps you start to see the problem here.

As it happens it's not possible for a program to tell what character encoding is used when it reads bytes from such a text file. Even in the wonderful world of closed source software this goes wrong and will need some work to get configured correctly. Seen it many times in Windows.

As for Linux on the Desktop, you missed it's arrival, it has been my primary desktop operating system since 1998. What has been stopping you?

Linux "officially" landed on the "desk top" some years ago with the Linux Subsystem for Windows. Which finally made Windows into an OS I could use to get actual work done. I have been using all manner of Free and Open Source software on Windows since.

Except, Windows keeps insisting on switching my keyboard from US to Finish layout without me telling to. In general it does all kind of things I don't ask it do and it's impossible to be sure what it will do next. Perfect examples of what is wrong with closed source :)
Memory in C++ is a leaky abstraction .

Heater
Posts: 15444
Joined: Tue Jul 17, 2012 3:02 pm

Re: How To Get Mousepad To Read Standard Text Files

Wed Mar 11, 2020 3:57 pm

Out of curiosity I created a text file using characters from the iso-8859-14 standard encoding.

Sure enough when opening it Windows Notepad it is rendered incorrectly.

Wordpad got it right.

Microsoft's VS Code said "File is not displayed in the editor because it is either binary or uses an unsupported encoding. Do you want to open it anyway?

On opening it anyway it displayed this "������������������������������������������������������������������������������������������������"
Memory in C++ is a leaky abstraction .

pica200
Posts: 216
Joined: Tue Aug 06, 2019 10:27 am

Re: How To Get Mousepad To Read Standard Text Files

Wed Mar 11, 2020 4:20 pm

emma1997 wrote:
Wed Mar 04, 2020 12:27 am
Also should mention that with only 120 megabytes left on most of my own card partitions size does matter. Avoid bloatware is high on the list. Mousepad is around 400 megabytes but it's built-in so essentially 0. Notably SEE is 43 kbytes and no DLL, DOTNET, JAVA or other dependencies. Ahhh... progress.
Are you sure about that? Mousepad is just a simple C program. Possibly the dependencies are big since it belongs to xfce which Raspbian doesn't use.

https://github.com/xfce-mirror/mousepad

User avatar
PeterO
Posts: 5729
Joined: Sun Jul 22, 2012 4:14 pm

Re: How To Get Mousepad To Read Standard Text Files

Wed Mar 11, 2020 4:39 pm

pica200 wrote:
Wed Mar 11, 2020 4:20 pm
emma1997 wrote:
Wed Mar 04, 2020 12:27 am
Also should mention that with only 120 megabytes left on most of my own card partitions size does matter. Avoid bloatware is high on the list. Mousepad is around 400 megabytes but it's built-in so essentially 0. Notably SEE is 43 kbytes and no DLL, DOTNET, JAVA or other dependencies. Ahhh... progress.
Are you sure about that? Mousepad is just a simple C program. Possibly the dependencies are big since it belongs to xfce which Raspbian doesn't use.

https://github.com/xfce-mirror/mousepad
And since it would be useless without installing its dependencies the total size (application + libraries) is the relevant figure !

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
buja
Posts: 558
Joined: Wed Dec 31, 2014 8:21 am
Location: Netherlands

Re: How To Get Mousepad To Read Standard Text Files

Wed Mar 11, 2020 5:01 pm

Not relevant for this topic, but this raises the question why Mousepad replaced Leafpad in Raspbian, since Raspbian is LXDE based.

From Mousepad Help/About: Mousepad is a fast text editor for the Xfce Desktop Environment.

From Leafpad Help/About: GTK+ based simple text editor
Additional information from https://wiki.lxde.org/en/Leafpad: Leafpad is the standard text editor of LXDE.

Of course Leafpad is just a sudo apt install leafpad away, so it's not the end of the world (and Mousepad can be removed in much the same way).

Return to “General discussion”