From: Joseph Brenner <doom@kzsu.stanford.edu>
To: help-gnu-emacs@gnu.org
Subject: Re: non-ascii chars in octal in sub-shell windows
Date: Fri, 15 Jan 2010 14:08:11 -0800 [thread overview]
Message-ID: <87ska7auno.fsf@kzsu.stanford.edu> (raw)
In-Reply-To: mailman.1459.1263545434.18930.help-gnu-emacs@gnu.org
Peter Dyballa <Peter_Dyballa@Web.DE> writes:
> Joseph Brenner:
>> When running a program that outputs utf-8 characters such as u-umlaut,
>> in a terminal window I'll see the actual character, but in an emacs
>> sub-shell I'm seeing the octal form (which looks like: \374).
>
> No, you're not running such a programme! The LATIN SMALL LETTER U
> WITH DIAERESIS, ü, is encoded in UTF-8 as C3BC. In UTF-16 it is
> 00FC – exactly two bytes! Obviously your programme just outputs
> some ISO Latin dialect or such...
Correct.
If anyone's interested in the details of the screw-up, here's some
off-topic chattering about perl programming:
A typical perl test script is based on the Test::More module,
which provides features to do checks such as:
is_deeply( $some_structure, $expected_structure,
"Testing whether structure is as expected.");
This routine outputs different messages to STDOUT and/or STDERR
depending on whether the check passes or fails.
I was seeing octal junk in those output messages, even after adding
some commands to the *.t script like so:
binmode STDOUT, ':encoding(utf8)';
binmode STDERR, ':encoding(utf8)';
Normally, that would be all it would take to convince perl it needs to
output UTF-8, in the case of Test::More routines, this approach fails,
because it creates new output handles of it's own.
Unbeknownst to me, the documentation for Test::More has been
recommending doing something more like this:
my $builder = Test::More->builder;
binmode $builder->output, ":encoding(utf8)";
binmode $builder->failure_output, ":encoding(utf8)";
Note that merely doing this sort of thing has no effect:
use utf8;
use locale;
prev parent reply other threads:[~2010-01-15 22:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-15 3:22 non-ascii chars in octal in sub-shell windows Joseph Brenner
2010-01-15 8:08 ` Eli Zaretskii
[not found] ` <mailman.1455.1263542904.18930.help-gnu-emacs@gnu.org>
2010-01-15 8:41 ` Joseph Brenner
2010-01-15 8:50 ` Peter Dyballa
[not found] ` <mailman.1459.1263545434.18930.help-gnu-emacs@gnu.org>
2010-01-15 22:08 ` Joseph Brenner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ska7auno.fsf@kzsu.stanford.edu \
--to=doom@kzsu.stanford.edu \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.