[Top][All Lists]

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

Re: Creating a coding system

From: Andreas Schwab
Subject: Re: Creating a coding system
Date: Sat, 20 Dec 2014 14:51:24 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

David Kastrup <address@hidden> writes:

> Ok, what am I doing wrong here?  Why does decode-coding-string not do
> anything here?
> (define-translation-table 'midi-decode-table
>   (make-translation-table-from-alist
>    (mapcar
>     (lambda (p)
>       (cons (car p) (string-to-vector (cdr p))))
>     '(([144 0] . "c,,,,")

The translation table operates on the decoded contents.

> (prin1 (decode-coding-string "\220\040" 'midi))

(aref (string-make-multibyte "\220\040") 0) => 4194192


Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

reply via email to

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