unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: patrol <patrol_boat@hotmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: character encoding confusion
Date: Wed, 7 Jul 2010 17:19:52 -0700 (PDT)	[thread overview]
Message-ID: <d8471b2d-27e0-4a7e-bc94-8372d2df3f01@r27g2000yqb.googlegroups.com> (raw)
In-Reply-To: 87pqyygbpm.fsf@kuiper.lan.informatimago.com

On Jul 7, 6:37 pm, p...@informatimago.com (Pascal J. Bourguignon)
wrote:
>
> Remember that C only deals with integer.  There is no character type in C.

I thought there was a char data type. Well, not exactly sure the
relevence of that...

> So, what happens when you call: printf("%c",176); ?

Well as I said in my post, I get a shaded square. But printf("%c",
248) yields the degree sign. But like I said, under Latin-1 and UTF-8,
176 is the degree sign, not 248.

> Have a look at setlocale, LC_ALL, etc, and libiconv.

I don't have any experience with this, but I did printf("%d", LC_ALL),
which returned 0. Don't know what that means, but I'm not sure why
locale settings should matter. Aren't Latin-1 and UTF-8 universal
encodings? If a file is encoded in Latin-1, wouldn't the degree sign
map to 176 regardless of locale?


  reply	other threads:[~2010-07-08  0:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-07 16:27 character encoding confusion patrol
2010-07-07 22:37 ` Pascal J. Bourguignon
2010-07-08  0:19   ` patrol [this message]
2010-07-08  1:15     ` Barry Margolin
2010-07-08 15:40     ` Pascal J. Bourguignon
2010-07-08  1:38 ` John Bokma
2010-07-08 13:24   ` patrol
2010-07-08  7:32 ` Tim X
2010-07-08 13:30   ` patrol

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d8471b2d-27e0-4a7e-bc94-8372d2df3f01@r27g2000yqb.googlegroups.com \
    --to=patrol_boat@hotmail.com \
    --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.
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).