encoding problem in temp-buffer

17 views
Skip to first unread message

Uwe Mayer

unread,
May 13, 2006, 2:18:25 PM5/13/06
to
Hi,

when executing "M-x compile" (which executes "make") and I have an error in
my sources emacs shows i.e. the following in the compilation temporary
buffer:
...
pingpong.cpp: In function \342\200\230int main(int, char**)\342\200\231:
pingpong.cpp:51: error: expected `;' before \342\200\230}\242\200\231 token
...

I am disturbed by the \xxx\yyy\zzz characters. I figured something is wrong
with my locale settings - I just don't know which screw to tighten.

locales are set to "en_GB.UTF-8" (LANG, LC_*), the source file in utf-8
encoding. Any ideas?

Thanks,
Uwe
--
One picture is worth more than ten thousand words.
-- Chinese proverb

Drew Adams

unread,
May 13, 2006, 2:48:11 PM5/13/06
to help-gn...@gnu.org
One picture is worth more than ten thousand words.
-- Chinese proverb

Hmm. The English proverb is "A picture is worth a thousand words". By simple
arithmetic, a Chinese picture is worth more than ten English pictures ;-).
More megapixels perhaps.

Eli Zaretskii

unread,
May 13, 2006, 3:03:36 PM5/13/06
to help-gn...@gnu.org
> From: Uwe Mayer <mer...@hadiko.de>
> Date: Sat, 13 May 2006 20:18:25 +0200

>
> when executing "M-x compile" (which executes "make") and I have an error in
> my sources emacs shows i.e. the following in the compilation temporary
> buffer:
> ...
> pingpong.cpp: In function \342\200\230int main(int, char**)\342\200\231:
> pingpong.cpp:51: error: expected `;' before \342\200\230}\242\200\231 token
> ...
>
> I am disturbed by the \xxx\yyy\zzz characters. I figured something is wrong
> with my locale settings - I just don't know which screw to tighten.
>
> locales are set to "en_GB.UTF-8" (LANG, LC_*), the source file in utf-8
> encoding. Any ideas?

Does it help if you type "C-x RET c utf-8 RET" immediately before
invoking "M-x compile"?


Uwe Mayer

unread,
May 13, 2006, 4:32:33 PM5/13/06
to
Saturday 13 May 2006 21:03 pm Eli Zaretskii wrote:

> Does it help if you type "C-x RET c utf-8 RET" immediately before
> invoking "M-x compile"?

yes! That does the trick.

I did some experimens with what I found on google
(http://www.gnu.org/software/emacs/manual/html_node/Specify-Coding.html),
but changing any of the variables did not work. Specifically
set-buffer-process-coding-system (interactive) requires 1. process, 2.
encoding, but only accepts an incoding as first input (?!).

Changing LC_ALL to "C" does the trick, too. :/

Ciao
Uwe
--
He's dead, Jim.

Eli Zaretskii

unread,
May 13, 2006, 11:18:27 PM5/13/06
to help-gn...@gnu.org
> From: Uwe Mayer <mer...@hadiko.de>
> Date: Sat, 13 May 2006 22:32:33 +0200

>
> Saturday 13 May 2006 21:03 pm Eli Zaretskii wrote:
>
> > Does it help if you type "C-x RET c utf-8 RET" immediately before
> > invoking "M-x compile"?
>
> yes! That does the trick.
>
> I did some experimens with what I found on google
> (http://www.gnu.org/software/emacs/manual/html_node/Specify-Coding.html),
> but changing any of the variables did not work. Specifically
> set-buffer-process-coding-system (interactive) requires 1. process, 2.
> encoding, but only accepts an incoding as first input (?!).

What happens if you say "M-x prefer-coding-system RET utf-8 RET" --
does Emacs display output from "M-x compile" correctly then?


Peter Dyballa

unread,
May 14, 2006, 5:07:55 AM5/14/06
to mer...@hadiko.de, help-gn...@gnu.org

Am 13.05.2006 um 22:32 schrieb Uwe Mayer:

> Changing LC_ALL to "C" does the trick, too. :/

I have only set LC_CTYPE and LANG to be "de_DE.UTF-8" and do not do
'set-language-environment' in .emacs, and most of my buffers are
UTF-8 encoded.

--
Mit friedvollen Grüßen

Pete

Alle reden vom Wetter - die Bahn fährt nicht.


Uwe Mayer

unread,
May 14, 2006, 5:39:03 AM5/14/06
to
Sunday 14 May 2006 05:18 am Eli Zaretskii wrote:

> What happens if you say "M-x prefer-coding-system RET utf-8 RET" --
> does Emacs display output from "M-x compile" correctly then?

That did the trick. Adding
(prefer-coding-system 'utf-8)

to the .emacs solved the problem.
Thanks for all the replies!

Ciao
Uwe
--
Only those who leisurely approach that which the masses are busy about
can be busy about that which the masses take leisurely.
-- Lao Tsu

Cor Gest

unread,
May 14, 2006, 10:08:18 AM5/14/06
to

Some entity AKA "Drew Adams" <drew....@oracle.com>
wrote this mindboggling stuff:

(selectively-snipped-or-not-p)

No, but some chinese characters take atleast 10 english words to express their
true meaning, and some a lifetime of study. ;-)

Cor

--
I do not use Windows (tm) therefore I do not fear mail from strangers
If everything else failed to satisfy you, try reading The Frign' Manual
(defvar My-Computer '((OS . "GNU/Emacs") (IPL . "GNU/Linux")))
http://www.clsnet.nl

Eli Zaretskii

unread,
May 14, 2006, 3:46:07 PM5/14/06
to help-gn...@gnu.org
> From: Peter Dyballa <Peter_...@Web.DE>
> Date: Sun, 14 May 2006 11:07:55 +0200
> Cc: help-gn...@gnu.org

>
>
> Am 13.05.2006 um 22:32 schrieb Uwe Mayer:
>
> > Changing LC_ALL to "C" does the trick, too. :/
>
> I have only set LC_CTYPE and LANG to be "de_DE.UTF-8" and do not do
> 'set-language-environment' in .emacs, and most of my buffers are
> UTF-8 encoded.

Are using the CVS version of Emacs 22? The OP used 21.x, IIRC.


Peter Dyballa

unread,
May 14, 2006, 5:42:34 PM5/14/06
to Eli Zaretskii, help-gn...@gnu.org

Am 14.05.2006 um 21:46 schrieb Eli Zaretskii:

>> I have only set LC_CTYPE and LANG to be "de_DE.UTF-8" and do not do
>> 'set-language-environment' in .emacs, and most of my buffers are
>> UTF-8 encoded.
>
> Are using the CVS version of Emacs 22? The OP used 21.x, IIRC.

This one and 23.0.0, but 21.3.50-20041117 works the same (21.4 is not
yet available from Fink for Mac OS X, only 22 in the modern
department, so I'm not using it).

--
Greetings

Pete

Basic, n.:
A programming language. Related to certain social diseases in
that those who have it will not admit it in polite company.


Eli Zaretskii

unread,
May 14, 2006, 11:36:21 PM5/14/06
to help-gn...@gnu.org
> Cc: help-gn...@gnu.org
> From: Peter Dyballa <Peter_...@Web.DE>
> Date: Sun, 14 May 2006 23:42:34 +0200

>
>
> Am 14.05.2006 um 21:46 schrieb Eli Zaretskii:
>
> >> I have only set LC_CTYPE and LANG to be "de_DE.UTF-8" and do not do
> >> 'set-language-environment' in .emacs, and most of my buffers are
> >> UTF-8 encoded.
> >
> > Are using the CVS version of Emacs 22? The OP used 21.x, IIRC.
>
> This one and 23.0.0, but 21.3.50-20041117 works the same

These both are from CVS (21.3.50-20041117 is from before it was
decided that the next release will be 22.1). The OP used a released
21.x version, which includes none of the enhancements to text
decoding.

Reply all
Reply to author
Forward
0 new messages