Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
I am extremely frustrated with this basic functionality issue within GNU/Linux. Why isn't there a simple program like Microsoft Windows' Notepad? One which is format stupid (ASCII only), so I ...
  1. #1
    Just Joined!
    Join Date
    Mar 2011
    Posts
    3

    Looking for a DUMB Notepad Equivalent

    I am extremely frustrated with this basic functionality issue within GNU/Linux.

    Why isn't there a simple program like Microsoft Windows' Notepad? One which is format stupid (ASCII only), so I can over-ride hidden html character entities. The other day I found myself wasting hours trying to get the Xephyr to work by cutting and pasting the terminal instructions from the following website into a gnome-terminal session - but each time it would give me the same, small window. I tried copying the text from the browser (using copy and paste) to gedit, but gedit was not showing the hidden character entities from the html code. After all this lost time trying different resolution sizes, I became suspicious that something was interfering with my cutting and pasting between gedit and the CLI terminal. Sure enough when I compared the webpage source code it gave me the clue to the problem.

    From the same page - two examples:
    Hidden character (notice the '×' or × )
    $ Xephyr -ac -screen 1280×786 -br -reset -terminate 2> /dev/null :2 &
    NO hidden character (notice the 'x')
    $ Xephyr -ac -screen 1280x1024 -br -reset -terminate 2> /dev/null :1 &

    ------ original url ---------
    marionote.wordpress.com/2010/03/07/ubuntu-xdmcp-access-with-xephyr/

    Every text editor I have tried - except 'TextEdit' & 'AbiWord' (overkill) - failed to either show the hidden characters or to allow for a "save as" in a simple text-only, which would eliminate these charaters. Here are the programs I've tried so far:

    emacs
    gedit
    gnote
    jed
    kate
    kwrite
    leafpad
    nano
    nano-tiny
    nedit
    openoffice (text only, pdf, etc...)
    the (could never figure this one out)
    vim

    Also check for settings in the following CLI:
    konsole
    gnome-terminal

    I even tried cutting and pasting out of the terminal yet somehow it retained the hidden characters.

    I could not find any preference setting in any of these programs which would allow for either eliminating the hidden characters doing a cut and paste or at least revealing them. I would like to plead to programmers out there for this basic functionality...

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,970
    There are a lot of very good basic text editors for Linux. My favorite is nedit, but a lot of people like gedit or vim.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Nov 2007
    Location
    San Diego
    Posts
    17
    I don't think this has anything to do with which editor the text is copied to, but rather how the text was generated to begin with. Whatever you copy may or may not appear as an 'x' character to the eye, but the actual character is not an 'x', so even notepad cannot help with this.

    Using the "Copy as Plain Text" plugin for Firefox does not help either, as the ASCII code is there instead of an actual 'x' character, so copying plain text will get whatever code is there -- "&#215 ;".

    In DOS/Windows, you can use the number keypad to see the characters.

    Alt- 120 = x
    Alt-0215 = ×

    Notice that they are two different symbols.

    Copy and paste into any ASCII editor, and the results should be the same. The question is, why does the site listed use that weird character instead of a normal 'x'? Microsoft Word is famous for giving unwanted characters, but another program may have done that when generating html code.

  4. #4
    Just Joined! vtel57's Avatar
    Join Date
    Mar 2011
    Location
    Tampa, Florida, USA
    Posts
    16
    My favorite command line editor is Vim (Nano a close second). My favorite just plain-jane text editor, a la MS Notepad, is Mousepad.

  5. #5
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    Location
    the hills
    Posts
    1,114
    This is disturbing. It isn't just the editor. The character
    is unicode and has no ascii counterpart. The whole
    system "interprets" the bytes C3 and 97
    as a character that looks like an ordinary x.

    Naturally, when you copy and paste the text into a configuration
    file that expects ascii, it bombs. It is the fault of the web site,
    for using non ascii characters in a place where normal people
    would expect to copy and paste the text.

    Expect more of this trouble as we make the full transition to
    unicode.

  6. #6
    Linux Newbie
    Join Date
    Nov 2008
    Location
    Tokyo, Japan
    Posts
    243
    Quote Originally Posted by Orang_Gila View Post
    From the same page - two examples:
    Hidden character (notice the '×' or × )
    $ Xephyr -ac -screen 1280×786 -br -reset -terminate 2> /dev/null :2 &
    NO hidden character (notice the 'x')
    $ Xephyr -ac -screen 1280x1024 -br -reset -terminate 2> /dev/null :1 &

    Every text editor I have tried - except 'TextEdit' & 'AbiWord' (overkill) - failed to either show the hidden characters or to allow for a "save as" in a simple text-only, which would eliminate these charaters.
    I know for a fact that "vim" displays hidden characters. You can edit a binary file with "vim" without playing with any parameters at all, it is the default behavior to show hidden characters.

    What web browser and desktop environment do you use? My guess is that the non-ascii characters are filtered out somewhere between your browser and Gnome (or KDE or whatever). This isn't a lack of functionality, this is (probably) a security feature. You don't want users who don't know what they are doing copying binary executable data into a text file with the clipboard. If they are using the clipboard for non-ascii or non-UTF8 data, chances are they are un-computer-savvy enough to be tricked into chmod'ing the file and executing it too.

    Copy-paste is not secure, and is intended to be a VERY LIMITED function. It should only be used in the simplest, most benign every-day tasks. If you need special characters transferred from place to place, use the myriad of character processing tools in Linux.
    • wget -- downloads web pages in tact without fiddling with the character format
    • iconv -- converts characters from one format to another
    • gvim -- the GTK-friendly version of "vim". "vim" is most advanced text editor ever made, can view non-ascii output from iconv
    • tr -- translates characters according to simple rules specified on the command line.

  7. #7
    Just Joined!
    Join Date
    Mar 2011
    Posts
    3
    Just to repeat the question: Why isn't there a simple program like Microsoft Windows' Notepad? One which is format stupid (ASCII only), so I can over-ride hidden html character entities.

    Went back to VIM to see if I could get VIM to display the hidden html characters from my example above. It is true that if I use the :set list or :set invlist VIM will display the non-printable hidden characters but it did not show the hidden html character entities in my example. I also tried GVIM, which even though it makes the complexities of VIM more user friendly, still did not have any settings for viewing these html characters. A package called CREAM came closest to showing that there was something hiding when I set the File Encoding > Western European > Western (ISO-8859-1). But it still requires my manual editing out of these hidden characters before saving the file, because it does not toss the hidden characters upon saving the file. Some days I am frantically visually scanning and copying helpful suggestions from websites while trying to solve a problem. As an un-computer-savvy-user I liked the stupidness of Notepad; it made the process simple because I knew that when I saved the file all the weird stuff was tossed.

    * wget -- downloads web pages in tact without fiddling with the character format
    Currently if I want to download a particular page from a website I just print it as a pdf file (forgoing the hyper links).

    * iconv -- converts characters from one format to another
    I am not trying to save any special characters, I am just tossing them.

    * gvim -- the GTK-friendly version of "vim". "vim" is most advanced text editor ever made, can view non-ascii output from iconv
    How? Are we talking only about hidden non-printable characters?

    I am using Firefox 3.6.15 (abrowser) inside Gnome.

  8. #8
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,970
    There are a lot of simple editors. Try nedit. If it isn't in your repositories, you can get it from sourceforge.net.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  9. #9
    Linux Newbie
    Join Date
    Nov 2008
    Location
    Tokyo, Japan
    Posts
    243
    OK, I think I see what you are saying now.

    You want all non-ASCII characters to dissappear. Linux is specifically designed NOT to filter non-ASCII characters. It would be very unkind to our non-English speaking friends if they were trying to copy-paste Japanese text from Firefox to Gedit and it filtered out all non-ASCII characters (i.e. all characters). And it isn't a "feature" to behave like MS Notepad and filter out non-ASCII characters, this behavior is in fact due to a poor design in MS Notepad. Let me explain:

    For a time, Linux was like Windows, relying on a "locale" environment variable to tell the system which character set to use, ASCII, EUC Japanese, JIS Japanese, whatever. But all of these different character encoding formats got to be very confusing, especially for programmers who wanted their programs to be good in any language. So they quit with all of the specialized character sets and started using one single universal character format for everything: Unicode. UTF-8 is a version of Unicode that is completely backwards compatible with ASCII, and so all modern Linux programs use it, from Firefox, to Gnome's clipboard, to Gedit. Linux programmers use UTF-8 for everything.

    If you want mimic the poor design of MS Notepad and forcefully filter out all non-ASCII characters in a file, as in all characters between 0x00 and 0x7E, you can use a simple one-line Perl command:
    Code:
    perl -e 'while(<>) { s/[^[:ascii:]]//g; print; }' <example.html
    You can then use this script as an extension to a clipboard manager like Glipper or some other such program to delete non-ASCII characters to any text you copy into the clipboard.

    If I haven't answered your question then I have to say, I don't think you are asking the right question.
    Quote Originally Posted by Orang_Gila View Post
    Just to repeat the question: Why isn't there a simple program like Microsoft Windows' Notepad? One which is format stupid (ASCII only), so I can over-ride hidden html character entities.
    What do you mean by "override?" If by that you mean "replace", then use "iconv". If by "override" you mean "delete", then use the above Perl script. Otherwise, there are LOTS of "dumb" text editors. Every major Linux desktop environment has one.
    • Gnome has "gedit"
    • KDE has "kate"
    • Xfce has "mousepad", intentionally intended to be more like MS "Notepad".
    But as a policy they all use UTF-8. You can try setting the "locale" to "C" with the file /etc/default/locale and set the line that says "LANG" to:
    Code:
    LANG="C"
    But I doubt this will change the behavior of Firefox, Gnome's clipboard, or any text editors. Programmers have been trying to change absolutely everything over to use the single, simple, universal, UTF-8 format.

  10. #10
    Linux Newbie theKbStockpiler's Avatar
    Join Date
    Sep 2010
    Location
    Upstate NY
    Posts
    195

    Don't overlook...

    Don't overlook; Teagtk , Scribes, Geany , Anjuta and Bluefish. Fedora's WINE comes with word and note pad as well.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...