help-nano
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: View Latin1 encoded file in a terminal with LANG set to de_DE.UTF-8


From: Joachim Breit
Subject: Re: View Latin1 encoded file in a terminal with LANG set to de_DE.UTF-8
Date: Tue, 24 Sep 2024 10:10:29 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.1

Hi Benno,

I tried both of your advices. Fantastic! Both methods work. Thank you so much.

Regards
Jo



----------------------------------------------------------------------

Message: 1
Date: Fri, 20 Sep 2024 14:20:24 +0200
From: Joachim Breit <jbreit@nexgo.de>
To: help-nano@gnu.org
Subject: View Latin1 encoded file in a terminal with LANG set to
        de_DE.UTF-8
Message-ID: <2b51cc79-7db1-b370-452b-cfb159c65027@nexgo.de>
Content-Type: text/plain; charset=UTF-8; format=flowed

Hi,

I have a file encoded in Latin-1 (cp1252). When I open this file with
Nano (from a terminal window in KDE) lots of characters are not
displayed correctly), presumably because my system is set to UTF-8
(environment variable LANG=de_DE.UTF-8). The Nano menus are displayed fine.

My first idea was to do a 'export LANG=de_DE@euro' before starting Nano.
But then both the nano menus and the file are showing placeholder
characters for German Umlaute an Spanish accents.

As you may guess from the problem description I am not an expert. Am I
missing something? An encoding setting? Or is it a 'must' to have every
file in UTF-8? Please help.

Jo



------------------------------

Message: 2
Date: Fri, 20 Sep 2024 17:42:15 +0200
From: Benno Schulenberg <bensberg@telfort.nl>
To: help-nano@gnu.org
Subject: Re: View Latin1 encoded file in a terminal with LANG set to
        de_DE.UTF-8
Message-ID: <a918cf87-5429-4fd3-b24c-12f1cd56aef2@telfort.nl>
Content-Type: text/plain; charset="utf-8"; Format="flowed"


Op 20-09-2024 om 14:20 schreef Joachim Breit:
I have a file encoded in Latin-1 (cp1252). When I open this file with Nano
(from a terminal window in KDE) lots of characters are not displayed
correctly), presumably because my system is set to UTF-8 (environment
variable LANG=de_DE.UTF-8). The Nano menus are displayed fine.

My first idea was to do a 'export LANG=de_DE@euro' before starting Nano. But
then both the nano menus and the file are showing placeholder characters for
German Umlaute an Spanish accents.
When wanting to edit a file in a different encoding, the easiest
solution is to convert the file to UTF-8 first.  In your case:

    iconv -f cp1252 -t utf8  <yourfile  >editablefile

After editing, you can convert the file back, if needed.


If conversion is not an option, then you must set not only the
shell environment to the relevant locale, but you must also tell
the terminal what encoding to use.  For Konsole, that should be
somewhere in the Settings, probably the Advanced tab, Encoding,
West-European, and then ISO-8859-1.  After that close and restart
the terminal.  Then `export LANG=de_DE.iso88591`, and accented
characters should be shown properly.  (Don't forget to switch
the encoding of the terminal back afterwards.)


Benno
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: 
<https://lists.gnu.org/archive/html/help-nano/attachments/20240920/d131a40e/attachment.sig>

------------------------------

Subject: Digest Footer

_______________________________________________
Help-nano mailing list
Help-nano@gnu.org
https://lists.gnu.org/mailman/listinfo/help-nano


------------------------------

End of Help-nano Digest, Vol 190, Issue 1
*****************************************




reply via email to

[Prev in Thread] Current Thread [Next in Thread]