* desktop and encodings
@ 2005-05-19 15:59 Mads Jensen
2005-05-19 19:42 ` Kevin Rodgers
[not found] ` <mailman.901.1116535146.25862.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 8+ messages in thread
From: Mads Jensen @ 2005-05-19 15:59 UTC (permalink / raw)
Hi NG
I wish to have desktop-mode store the encodings, so I won't have to set
them manually after desktop opened with "C-x RET f RET encoding".
I once had this enabled, but lost the configuration. I'd be very
greatful if anyone knows how to do this.
--
Mads Jensen - mail sent to address ends in /dev/null
s/spam/madsj for emailing me
Research is what I'm doing when I don't know what I'm doing.
-- Wernher von Braun
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: desktop and encodings
2005-05-19 15:59 desktop and encodings Mads Jensen
@ 2005-05-19 19:42 ` Kevin Rodgers
[not found] ` <mailman.901.1116535146.25862.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 8+ messages in thread
From: Kevin Rodgers @ 2005-05-19 19:42 UTC (permalink / raw)
Mads Jensen wrote:
> I wish to have desktop-mode store the encodings, so I won't have to set
> them manually after desktop opened with "C-x RET f RET encoding".
(setq desktop-locals-to-save
(cons 'buffer-file-coding-system desktop-locals-to-save))
--
Kevin Rodgers
^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <mailman.901.1116535146.25862.help-gnu-emacs@gnu.org>]
* Re: desktop and encodings
[not found] ` <mailman.901.1116535146.25862.help-gnu-emacs@gnu.org>
@ 2005-05-21 18:33 ` Mads Jensen
2005-05-21 19:26 ` Peter Dyballa
[not found] ` <mailman.1215.1116704427.25862.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 8+ messages in thread
From: Mads Jensen @ 2005-05-21 18:33 UTC (permalink / raw)
Kevin Rodgers <ihs_4664@yahoo.com> writes:
> (setq desktop-locals-to-save
> (cons 'buffer-file-coding-system desktop-locals-to-save))
This leaves me with one major problem, though. I occassionally use the
Danish special characters æ, ø and å (ae, oe and aa, if they come out as
weird symbols) in unicode, and when I then open emacs, they come out
incorrectly, so I sometimes have to spend some time replacing those
symbols into the right characters, if I briefly forgot about the bug and
saved the file.
I use emacs GNU Emacs 21.3.2 on Slackware 10.1 with the default LANG=
variables set to "en_US" in /etc/profile.d/lang.sh
I'd be very happy if anyone has a solution to this problem.
--
Mads Jensen - mail sent to address ends in /dev/null
s/spam/madsj for emailing me
Research is what I'm doing when I don't know what I'm doing.
-- Wernher von Braun
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: desktop and encodings
2005-05-21 18:33 ` Mads Jensen
@ 2005-05-21 19:26 ` Peter Dyballa
[not found] ` <mailman.1215.1116704427.25862.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 8+ messages in thread
From: Peter Dyballa @ 2005-05-21 19:26 UTC (permalink / raw)
Cc: help-gnu-emacs
Am 21.05.2005 um 20:33 schrieb Mads Jensen:
> I use emacs GNU Emacs 21.3.2 on Slackware 10.1 with the default LANG=
> variables set to "en_US" in /etc/profile.d/lang.sh
>
> I'd be very happy if anyone has a solution to this problem.
>
That's probably the reason why you have these problems! Set LANG to
Danish in some ISO 8859 encoding or in UTF-8! Maybe da_DA.UTF-8 ...
The other thing you can do: give all your files with non-US ASCII
content in the header a remark like:
;;; -*- mode: Text; coding: iso-8859-4; -*-
GNU Emacs will learn from that this text files contents is Northern ISO
Latin.
--
Greetings
<]
Pete o __o |__ o recumbo
___o /I -\<, |o \ -\),-% ergo sum!
___/\ /\___./ \___...O/ O____.....`-O-'-()--o_________________
^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <mailman.1215.1116704427.25862.help-gnu-emacs@gnu.org>]
* Re: desktop and encodings
[not found] ` <mailman.1215.1116704427.25862.help-gnu-emacs@gnu.org>
@ 2005-05-23 14:13 ` Mads Jensen
2005-05-23 15:46 ` Peter Petersen
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Mads Jensen @ 2005-05-23 14:13 UTC (permalink / raw)
Peter Dyballa <Peter_Dyballa@Web.DE> writes:
> That's probably the reason why you have these problems! Set LANG to
> Danish in some ISO 8859 encoding or in UTF-8! Maybe da_DA.UTF-8 ...
I tried setting the LANG variable to both da_DA, da_DA.utf-8,
da_DA.iso-8859-1 plus en_US... (the same LANG variables as mentioned
before, just with a different language), but that did not help :-/
> The other thing you can do: give all your files with non-US ASCII
> content in the header a remark like:
>
> ;;; -*- mode: Text; coding: iso-8859-4; -*-
> GNU Emacs will learn from that this text files contents is Northern ISO
> Latin.
Did not help either. I tried writing "æøå" in my ~/.bashrc, which I've
set to UTF-8 with C-x RET f RET utf-8 RET and tested with all the
aforementioned locales, but same result, æøå gets turned into something
like ¥...
I tried searching groups.google.com, but no help to find there :-(
Thanks for the help.
--
Mads Jensen - mail sent to address ends in /dev/null
s/spam/madsj for emailing me
Research is what I'm doing when I don't know what I'm doing.
-- Wernher von Braun
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: desktop and encodings
2005-05-23 14:13 ` Mads Jensen
@ 2005-05-23 15:46 ` Peter Petersen
2005-05-23 18:01 ` Peter Dyballa
[not found] ` <mailman.1451.1116871733.25862.help-gnu-emacs@gnu.org>
2 siblings, 0 replies; 8+ messages in thread
From: Peter Petersen @ 2005-05-23 15:46 UTC (permalink / raw)
* Mads Jensen <spam@raptus.dk> schrieb:
> I tried setting the LANG variable to both da_DA, da_DA.utf-8,
> da_DA.iso-8859-1 plus en_US... (the same LANG variables as mentioned
> before, just with a different language), but that did not help :-/
>
<...>
>
> Did not help either. I tried writing "æøå" in my ~/.bashrc, which I've
> set to UTF-8 with C-x RET f RET utf-8 RET and tested with all the
> aforementioned locales, but same result, æøå gets turned into something
> like ¥...
Hi,
>From a text console I launch Emacs like this:
LC_CTYPE=de_DE.utf8 exec filterm - dynafont emacs -nw --eval
"(set-keyboard-coding-system 'latin-9)"
(LC_CTYPE doesn't even seem to be needed...)
filterm is part of the "konwert" and "konwert-filters" packages, and
"dynafont" is one of its filters allowing me to read and reply to utf-8
texts (for instance when using the newsreader Gnus).
I described some problems with filterm recently, but was able to solve
them (now control-g works again!). filterm and dynafont switch your
console to utf-8 mode and also take care to chose a utf-8 capable screen
font etc.
This is just something that crossed my mind - I don't know if this fits
to your situation.
Let's see:
æ ø å
€
äöü
ß
éèê
ñ
;-)
Best regards from Germany
Peter Petersen
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: desktop and encodings
2005-05-23 14:13 ` Mads Jensen
2005-05-23 15:46 ` Peter Petersen
@ 2005-05-23 18:01 ` Peter Dyballa
[not found] ` <mailman.1451.1116871733.25862.help-gnu-emacs@gnu.org>
2 siblings, 0 replies; 8+ messages in thread
From: Peter Dyballa @ 2005-05-23 18:01 UTC (permalink / raw)
Cc: help-gnu-emacs
Am 23.05.2005 um 16:13 schrieb Mads Jensen:
> æøå gets turned into something like Â¥...
>
What see is the 'translation' of some ISO Latin encoding into UTF-8 and
then displaying these double byte values as unibytes!
This could explain a bit:
; oct dec hex UCS2 UTF-8
;=====================================
= 240 = 160 = A0 = U+00A0 = C2 A0 : NO-BREAK SPACE
Ą = 241 = 161 = A1 = U+0104 = C4 84 : LATIN CAPITAL LETTER A WITH
OGONEK
ĸ = 242 = 162 = A2 = U+0138 = C4 B8 : LATIN SMALL LETTER KRA
Ŗ = 243 = 163 = A3 = U+0156 = C5 96 : LATIN CAPITAL LETTER R WITH
CEDILLA
¤ = 244 = 164 = A4 = U+00A4 = C2 A4 : CURRENCY SIGN
Ĩ = 245 = 165 = A5 = U+0128 = C4 A8 : LATIN CAPITAL LETTER I WITH
TILDE
Ļ = 246 = 166 = A6 = U+013B = C4 BB : LATIN CAPITAL LETTER L WITH
CEDILLA
§ = 247 = 167 = A7 = U+00A7 = C2 A7 : SECTION SIGN
¨ = 250 = 168 = A8 = U+00A8 = C2 A8 : DIAERESIS
Š = 251 = 169 = A9 = U+0160 = C5 A0 : LATIN CAPITAL LETTER S WITH
CARON
Ē = 252 = 170 = AA = U+0112 = C4 92 : LATIN CAPITAL LETTER E WITH
MACRON
Ģ = 253 = 171 = AB = U+0122 = C4 A2 : LATIN CAPITAL LETTER G WITH
CEDILLA
Ŧ = 254 = 172 = AC = U+0166 = C5 A6 : LATIN CAPITAL LETTER T WITH
STROKE
= 255 = 173 = AD = U+00AD = C2 AD : HYPHEN-MINUS
Ž = 256 = 174 = AE = U+017D = C5 BD : LATIN CAPITAL LETTER Z WITH
CARON
Á = 301 = 193 = C1 = U+00C1 = C3 81 : LATIN CAPITAL LETTER A WITH
ACUTE
 = 302 = 194 = C2 = U+00C2 = C3 82 : LATIN CAPITAL LETTER A WITH
CIRCUMFLEX
à = 303 = 195 = C3 = U+00C3 = C3 83 : LATIN CAPITAL LETTER A WITH
TILDE
Ä = 304 = 196 = C4 = U+00C4 = C3 84 : LATIN CAPITAL LETTER A WITH
DIAERESIS
Å = 305 = 197 = C5 = U+00C5 = C3 85 : LATIN CAPITAL LETTER A WITH
RING ABOVE
Æ = 306 = 198 = C6 = U+00C6 = C3 86 : LATIN CAPITAL LETTER AE
æ = 346 = 230 = E6 = U+00E6 = C3 A6 : LATIN SMALL LETTER AE
First column contains the glyphs as they are, next columns have the
glyph's byte value expressed as octal, decimal, or hexadecimal
numerals. Next column, UCS2, show the slot number (ASCII code) of that
glyph in Unicode (which, I think, is too the internal representation in
GNU Emacs). The next column now shows into which bytes the glyphs from
column 1 are translated as UTF-8. As you can see you can 'see' the
UTF-8 bytes as 'normal' characters, a UTF-8 encoded æ is just 'ÄĻ' if
displayed in ISO Latin-4, 'Ħ' in ISO Latin-1 ...
So, to conclude: your Emacs obviously saves your input as UTF-8, and
you have to make the buffer display in UTF-8 too! The correct headers
would look like
;;; -*- mode: Text; coding: utf-8; -*-
Once you have the file opened in the wrong encoding you can change that
with revert-buffer-with-coding-system, C-x RET r utf-8 RET.
Have you thought of
(prefer-coding-system 'utf-8-unix)
Could be it cures a lot. There is too (set-language-environment
'Danish) ...
--
Mit friedvollen Grüßen
Pete
In a world without walls and fences, who needs gates and windows?
^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <mailman.1451.1116871733.25862.help-gnu-emacs@gnu.org>]
* Re: desktop and encodings
[not found] ` <mailman.1451.1116871733.25862.help-gnu-emacs@gnu.org>
@ 2005-06-15 13:35 ` Mads Jensen
0 siblings, 0 replies; 8+ messages in thread
From: Mads Jensen @ 2005-06-15 13:35 UTC (permalink / raw)
Peter Dyballa <Peter_Dyballa@Web.DE> writes:
[snip]
> So, to conclude: your Emacs obviously saves your input as UTF-8, and you
> have to make the buffer display in UTF-8 too! The correct headers would
> look like
>
> ;;; -*- mode: Text; coding: utf-8; -*-
Yeah, just found out about that; it really makes everything a whole lot
easier.
> Once you have the file opened in the wrong encoding you can change that
> with revert-buffer-with-coding-system, C-x RET r utf-8 RET.
Thanks. There are so many things about Emacs, that I'm unfamiliar with,
so it's great learning about new stuff :-)
> (prefer-coding-system 'utf-8-unix)
I have both a (prefer-coding-system ...) for latin-1 and unicode, and
they appear to help a lot. Anyways, thanks!
--
Mads Jensen - mail sent to address ends in /dev/null
s/spam/madsj for emailing me
gpg: 7E775BDA
It is impossible to make anything foolproof because fools are so
ingenious.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2005-06-15 13:35 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-19 15:59 desktop and encodings Mads Jensen
2005-05-19 19:42 ` Kevin Rodgers
[not found] ` <mailman.901.1116535146.25862.help-gnu-emacs@gnu.org>
2005-05-21 18:33 ` Mads Jensen
2005-05-21 19:26 ` Peter Dyballa
[not found] ` <mailman.1215.1116704427.25862.help-gnu-emacs@gnu.org>
2005-05-23 14:13 ` Mads Jensen
2005-05-23 15:46 ` Peter Petersen
2005-05-23 18:01 ` Peter Dyballa
[not found] ` <mailman.1451.1116871733.25862.help-gnu-emacs@gnu.org>
2005-06-15 13:35 ` Mads Jensen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).