On Wed, Mar 27, 2019 at 01:57:38AM +0000, Ken Moffat via blfs-dev wrote:
>
> ĸen - slowly getting back to his firefox diff: does anyone know of
> a way to tell vim (i.e. 'view' with its nice colours) that a diff
> which starts with a lot of ASCII is actually UTF-8 ? I've already
> got: set fileencoding=utf-8 but when I eventually hit some UTF-8 in
> French translations (there might be who knows what encodings
> in other translations) I get doubled bytes for accented letters.
Well, I've sort-of got a way to handle this: two terms.
In the first, I open the diff in 'view'. For me, the benefits are
that in my preferred colorscheme (possibly, adapted with some tuning
of hte colours) added lines jump out in cyan (on a black
background), deleted lines are magenta - easy to concentrate on the
new lines.
The diff is regarded by 'file' as 'data' and I get the impression
that view is treating it as ASCII or latin1, despite me telling it
to use utf-8.
So, to read the garbled lines I also open the file with 'less' (set
for UTF-8, per my locale) and then use 'G' to go to a specific line.
This is much harder to identify the changed parts (all text is white
on black), but the text I have looked at des render correctly. The
latest example was using smart quotes.
Of course, this assumes that the terms have fonts to display the
text - for some (e.g. indian languages) that might not be true for
me. But this seems to be an effective workaround.
ĸen
--
It is said that there are two great unsolved problems in computer
science: naming, cache invalidation, and off-by-one errors.
-- Ben Bullock
--
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page