diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-03-17 18:23:04 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-03-17 18:23:04 -0700 |
commit | 59df78a7806764586e084eafd0842f43a741037a (patch) | |
tree | e40c375a5191a36e24bf5e4408e2edba440ab012 | |
parent | 34faa14e34c3eb2dfe3fd2cad02826f12f00ec5b (diff) | |
download | uemacs-59df78a7806764586e084eafd0842f43a741037a.tar.gz |
Turn NBSP into regular SP on input
Particularly pasting from a web browser, I get a lot of 'space' +
'non-breaking space' noise, and keeping the   as an actual unicode
character ends up being a major pain.
Note: this is only done on input. If the file contains the unicode
character U+00A0, we'll keep it that way. But you can't enter it from
the keyboard (or cut-and-paste, which ends up looking like keyboard
input).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | posix.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -213,6 +213,9 @@ int ttgetc(void) } bytes = utf8_to_unicode(buffer, 0, pending, &c); + /* Hackety hack! Turn no-break space into regular space */ + if (c == 0xa0) + c = ' '; done: pending -= bytes; memmove(buffer, buffer+bytes, pending); |