all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Leo Liu <sdl.web@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: How to use string-to/as-unibyte correctly?
Date: Wed, 22 Jun 2016 11:33:19 +0800	[thread overview]
Message-ID: <m24m8lrj7k.fsf@gmail.com> (raw)
In-Reply-To: jwv60t39x87.fsf-monnier+gmane.emacs.devel@gnu.org

On 2016-06-20 20:56 -0400, Stefan Monnier wrote:
[snipped 4 lines]
> The correct way to use them is to not use them and use
> encode/decode-coding-string instead.
>
>
>         Stefan

On 2016-06-21 05:36 +0300, Eli Zaretskii wrote:
[snipped 7 lines]
> Don't use them, period.  They are remnants from the era long gone,
> before Emacs used Unicode and UTF-8 as the basis for its internal
> representation of characters.  Nowadays the only place where such
> conversions are sometimes needed are on the C level, deep within Emacs
> internals.  Applications should never use them.
>
> I'm okay with declaring them obsolete, if it helps.

I had two cases of string-to-unibyte to mean I am expecting unibyte
string and will complain if given something else.

Looks like we'd better start the process of phasing out these functions
so that nobody will make the mistake of using them.

Leo




  reply	other threads:[~2016-06-22  3:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-20 23:40 How to use string-to/as-unibyte correctly? Leo Liu
2016-06-21  0:56 ` Stefan Monnier
2016-06-22  3:33   ` Leo Liu [this message]
2016-06-22  7:49     ` Andreas Schwab
2016-06-26  2:02       ` Leo Liu
2016-06-22 14:59     ` Eli Zaretskii
2016-06-25  1:57       ` Leo Liu
2016-06-25  8:01         ` Eli Zaretskii
2016-06-21  2:36 ` Eli Zaretskii
2016-06-26  2:01 ` Leo Liu

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=m24m8lrj7k.fsf@gmail.com \
    --to=sdl.web@gmail.com \
    --cc=emacs-devel@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.