From: Noam Postavsky <npostavs@gmail.com>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: Help Gnu Emacs mailing list <help-gnu-emacs@gnu.org>,
Helmut Eller <eller.helmut@gmail.com>
Subject: Re: Parsing of multibyte strings frpom process output
Date: Tue, 8 May 2018 08:21:33 -0400 [thread overview]
Message-ID: <CAM-tV--9WgAX8JDZpSgr+XE+Tfwhrraf0zFFOdJkHzMxhR5C1A@mail.gmail.com> (raw)
In-Reply-To: <87wowe1hm5.fsf@gmx.de>
On 8 May 2018 at 08:01, Michael Albinus <michael.albinus@gmx.de> wrote:
> --8<---------------cut here---------------start------------->8---
> (setq res-symlink-target
> ;; Parse multibyte codings.
> (decode-coding-string
> (replace-regexp-in-string
> "\\\\x\\([[:xdigit:]]\\{2\\}\\)"
> (lambda (x)
> (string
> (string-to-number (concat "3FFF" (match-string 1 x)) 16)))
> res-symlink-target)
> 'utf-8))
> --8<---------------cut here---------------end--------------->8---
I think making a unibyte string would fit better.
(let ((res-symlink-target "/home/albinus/tmp/\\xc2\\x9abung"))
(setq res-symlink-target (encode-coding-string
res-symlink-target
'us-ascii t))
(decode-coding-string
(replace-regexp-in-string
"\\\\x\\([[:xdigit:]]\\{2\\}\\)"
(lambda (x)
(unibyte-string
(string-to-number (match-string 1 x) 16)))
res-symlink-target)
'utf-8))
Although, both methods give me "/home/albinus/tmp/\232bung", so I
might be missing something...
next prev parent reply other threads:[~2018-05-08 12:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.13544.1525773753.27995.help-gnu-emacs@gnu.org>
2018-05-08 11:00 ` Parsing of multibyte strings frpom process output Helmut Eller
2018-05-08 12:01 ` Michael Albinus
2018-05-08 12:21 ` Noam Postavsky [this message]
2018-05-08 12:47 ` Michael Albinus
2018-05-08 10:02 Michael Albinus
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=CAM-tV--9WgAX8JDZpSgr+XE+Tfwhrraf0zFFOdJkHzMxhR5C1A@mail.gmail.com \
--to=npostavs@gmail.com \
--cc=eller.helmut@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=michael.albinus@gmx.de \
/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).