FunctionPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.1
Unrevised from 8.0 to 8.1.
8.0 version

find-locale

Arguments: name

name can be a locale or a string naming a locale or a symbol (in which case, the symbol-name is used) or a locale. If name is a locale, then name is returned.

If name is a string designator, then this function looks through all locales returned by all-locales to find a locale whose locale-name matches (i.e., is equalp to) name. If one such locale is found, it is returned.

If no such locale is found, then if the name includes a charset specification (i.e., has a period followed by a charset name), then the charset specification is passed to find-external-format and a base-locale is retrieved by calling find-locale recursively on name with the charset specification stripped. If both the charset specification names an external-format and the base-locale is a valid locale, then this function creates a new locale using all the slots of base-locale except for the external-format slot, which is set to the external-format corresponding to the specified charset.

If name does not specify a charset and it does not name an existing locale in Lisp, then this function searches the directory specified by *locales-dir* for a file with name's pathname-name and calls load-localedef on that pathname. If no such file exists with name's pathname-name, then a file in that directory whose name's prefix matches name may be selected. This search is case-sensitive. In this way, Allegro CL autoloads locale definitions.

If no locale or suitable file is found, nil is returned.

Examples:

(find-locale "pl")
  -> #<locale "pl_PL" [(:e-crlf :iso8859-2-base)] @ #x204de7ca>
(find-locale "en_US")
  -> #<locale "en_US" [(:e-crlf :latin1-base)] @ #x204e5812>
(locale-external-format (find-locale "en_US.iso8859-1"))
  -> #<external-format (:e-crlf :latin1-base) @ #x20096d02>
(locale-external-format (find-locale "en_US.shiftjis"))
  -> #<external-format (:e-crlf :shiftjis-base) @ #x2053dde2>

General information on international character set support in Allegro CL is in iacl.htm. See particularly External formats and locales in that document.


Copyright (c) 1998-2009, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 8.1. This page was not revised from the 8.0 page.
Created 2009.7.29.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.1
Unrevised from 8.0 to 8.1.
8.0 version