zsh-workers
 help / color / mirror / code / Atom feed
From: Borsenkow Andrej <Andrej.Borsenkow@mow.siemens.ru>
To: "'Clint Adams'" <clint@zsh.org>
Cc: "'Geoff Wing'" <gcw@zsh.org>, "'Zsh Hackers'" <zsh-workers@sunsite.dk>
Subject: RE: multibyte backwarddeletechar
Date: Mon, 22 Oct 2001 16:02:22 +0400	[thread overview]
Message-ID: <000f01c15af1$68294d80$21c9ca95@mow.siemens.ru> (raw)
In-Reply-To: <20011022073231.B31806@dman.com>

> 
> > implementation. Using wchar looks portable but the immediate problem
is
> > that conventional str* functions stop working. Using UTF-8 is
appealing
> 
> Since there are wide equivalents for most str* functions, that's not
> too severe a problem.
>

Mmm ... yes. We also need to deal with quoting; that may work just as it
works now with either char constants replaced by wchar constants (do not
know how portable it is) or by using btowc to convert them on the fly -
which assumes locale is upward compatible with ASCII (but we silently
assume it anyway).

> I did try once to replace shingetline with something that called
> a shingetwline (using wide equivalents) then ran it through wcstombs()
> to return the char * that was wanted.  It didn't function properly;
> probably something I don't understand about wide characters.

I am not sure I follow it. What you actually have to do is

- on input: either get plain characters and convert them using btowc
(that is O.K. as starting point) or read multibyte stream with mb*
functions and convert them with mbtowc (that is needed as final result
to be able to deal with UTF-8 encoding finally).

- on output: use either wctob or wctomb.

Looks like you did exactly opposite :-)


-andrej


  reply	other threads:[~2001-10-22 12:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-21 15:42 Clint Adams
2001-10-21 17:13 ` Bart Schaefer
2001-10-21 18:21   ` Clint Adams
2001-10-22  0:57 ` Geoff Wing
2001-10-22  1:50   ` Clint Adams
2001-10-22  3:23     ` Geoff Wing
2001-10-22 11:27       ` Clint Adams
2001-10-22  5:20   ` Borsenkow Andrej
2001-10-22 11:32     ` Clint Adams
2001-10-22 12:02       ` Borsenkow Andrej [this message]
2001-10-24 13:57         ` Clint Adams

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='000f01c15af1$68294d80$21c9ca95@mow.siemens.ru' \
    --to=andrej.borsenkow@mow.siemens.ru \
    --cc=clint@zsh.org \
    --cc=gcw@zsh.org \
    --cc=zsh-workers@sunsite.dk \
    /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 public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).