emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Towards a cleaner build: hexl


From: Lars Ingebrigtsen
Subject: Re: Towards a cleaner build: hexl
Date: Sat, 18 May 2019 07:07:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

> Howe about this instead:
>
>      (let ((encoded (encode-coding-char ch coding))
>          (internal (char-to-string ch))
>          internal-hex)
>        ;; If encode-coding-char returns nil, it means our character
>        ;; cannot be safely encoded with buffer-file-coding-system.
>        ;; In that case, we offer to insert the internal representation
>        ;; of that character, byte by byte.
>        (when (null encoded)
>        (setq internal (encode-coding-string internal 'utf-8-emacs)
>              internal-hex
>               (mapconcat (function (lambda (c) (format "%x" c)))
>                          internal " "))))
>
> Does this work?

Yes, it works for me if in my test case where char is ⚀ and the coding
system is iso-8859-1.  I'll make the change and push.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

[Prev in Thread] Current Thread [Next in Thread]