Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fare/asdf-encodings
Support encodings beside UTF-8 for Common Lisp source files using ASDF
https://github.com/fare/asdf-encodings
Last synced: 17 days ago
JSON representation
Support encodings beside UTF-8 for Common Lisp source files using ASDF
- Host: GitHub
- URL: https://github.com/fare/asdf-encodings
- Owner: fare
- License: mit
- Created: 2016-03-06T23:31:27.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-10-05T00:06:08.000Z (over 5 years ago)
- Last Synced: 2024-12-27T16:05:36.632Z (about 1 month ago)
- Language: Common Lisp
- Size: 24.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
ASDF-ENCODINGS
This library allows you to use ASDF with Lisp source files
that use an encoding different from either ASCII or UTF-8.
It depends on ASDF 2.21 or later (actually 2.20.18 or later).TODO:
(1) actually support more implementations.
(2) Add a test suite.
(3) Test it.
(4) Add more corner cases.==== Exported Functionality ====
The asdf-encodings defines a package ASDF-ENCODINGS.
It uses ASDF 2.21's asdf:*encoding-external-format-hook*
to define a simple mapping from encodings specified as portable keywords
to implementation-defined external formats.
It issues warnings or errors when no matching external-format is available,
depending on asdf-encodings.function ENCODING-EXTERNAL-FORMAT (ENCODING &KEY (ON-ERROR *ON-UNSUPPORTED-ENCODING*))
This function takes a keyword which is one of
:default
:utf-8 :utf8
:latin1 :latin-1 :iso-8859-1
a whole lot of other possibilities as per asdf-encodings::*encodings*
and returns a value suitable for use as :external-format argument to
the current implementation's CL:OPEN, CL:LOAD or CL:COMPILE-FILE functions.
If the encoding is not supported on this implementation, the ON-ERROR
argument, which is one of :ERROR, :WARN, NIL, specifies what to do.variable *ON-UNSUPPORTED-ENCODING*
One of :error, :warn or nil,
specifies what to do when passed an unsupported encoding.
Defaults to :error.function DETECT-FILE-ENCODING (PATHNAME)
This function takes a pathname designator,
and returns a portable encoding as detected by the file contents,
either an emacs-style -*- coding: foo -*- declaration,
or something deduced from the octet patterns in the file.function NORMALIZE-ENCODING (ENCODING)
Given a portable encoding keyword, returns the normalized keyword
describing that encoding on the current implementations, if any,
or NIL if the encoding is not present on the implementation
(or not recognized by asdf-encodings).function FIND-IMPLEMENTATION-ENCODING (ENCODING)
Given a normalized encoding keyword, returns
an external-format suitable for use on the current implementation, if any.