The asdf-encodings Reference Manual

Next: , Previous: , Up: (dir)   [Contents][Index]

The asdf-encodings Reference Manual

This is the asdf-encodings Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 03:12:43 2022 GMT+0.

Table of Contents


1 Introduction

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.


2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 asdf-encodings

Portable interface to character encodings and your implementation’s external-format

Author

Francois-Rene Rideau

Defsystem Dependency

asdf (system)., at least version "3.0"

Source

asdf-encodings.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.1 asdf-encodings/asdf-encodings.asd

Source

asdf-encodings.asd.

Parent Component

asdf-encodings (system).

ASDF Systems

asdf-encodings.


3.1.2 asdf-encodings/pkgdcl.lisp

Source

asdf-encodings.asd.

Parent Component

asdf-encodings (system).

Packages

asdf-encodings.


3.1.3 asdf-encodings/encodings.lisp

Dependency

pkgdcl.lisp (file).

Source

asdf-encodings.asd.

Parent Component

asdf-encodings (system).

Public Interface
Internals

3.1.4 asdf-encodings/autodetect.lisp

Dependency

pkgdcl.lisp (file).

Source

asdf-encodings.asd.

Parent Component

asdf-encodings (system).

Public Interface

detect-file-encoding (function).

Internals

3.1.5 asdf-encodings/asdf-support.lisp

Dependency

pkgdcl.lisp (file).

Source

asdf-encodings.asd.

Parent Component

asdf-encodings (system).

Public Interface
Internals

register-asdf-encodings (function).


3.1.6 asdf-encodings/initialization.lisp

Dependencies
Source

asdf-encodings.asd.

Parent Component

asdf-encodings (system).


4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 asdf-encodings

Source

pkgdcl.lisp.

Use List
  • asdf/interface.
  • common-lisp.
Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Public Interface


5.1.1 Special variables

Special Variable: *on-unsupported-encoding*

One of :error, :warn or nil, specifies what to do when passed an unsupported encoding.

Package

asdf-encodings.

Source

asdf-support.lisp.


5.1.2 Ordinary functions

Function: detect-file-encoding (file)
Package

asdf-encodings.

Source

autodetect.lisp.

Function: encoding-external-format (encoding &key on-error)
Package

asdf-encodings.

Source

asdf-support.lisp.

Function: find-implementation-encoding (encoding)
Package

asdf-encodings.

Source

encodings.lisp.

Function: normalize-encoding (encoding)
Package

asdf-encodings.

Source

encodings.lisp.


5.2 Internals


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.1 Special variables

Special Variable: *encodings*
Package

asdf-encodings.

Source

encodings.lisp.

Special Variable: *normalized-encodings*
Package

asdf-encodings.

Source

encodings.lisp.


Previous: , Up: Internals   [Contents][Index]

5.2.2 Ordinary functions

Function: decode-ascii-encoded-declaration (buffer available start size offset)
Package

asdf-encodings.

Source

autodetect.lisp.

Function: detect-buffer-encoding-header (buffer available)
Package

asdf-encodings.

Source

autodetect.lisp.

Function: detect-utf-8 (file)
Package

asdf-encodings.

Source

autodetect.lisp.

Function: initialize-normalized-encodings (&optional warn)
Package

asdf-encodings.

Source

encodings.lisp.

Function: register-asdf-encodings ()
Package

asdf-encodings.

Source

asdf-support.lisp.


Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts