You are viewing the version of this documentation from Perl 5.14.1. View the latest version



I18N::LangTags - functions for dealing with RFC3066-style language tags


use I18N::LangTags();

...or specify whichever of those functions you want to import, like so:

use I18N::LangTags qw(implicate_supers similarity_language_tag);

All the exportable functions are listed below -- you're free to import only some, or none at all. By default, none are imported. If you say:

use I18N::LangTags qw(:ALL)

...then all are exported. (This saves you from having to use something less obvious like use I18N::LangTags qw(/./).)

If you don't import any of these functions, assume a &I18N::LangTags:: in front of all the function names in the following examples.


Language tags are a formalism, described in RFC 3066 (obsoleting 1766), for declaring what language form (language and possibly dialect) a given chunk of information is in.

This library provides functions for common tasks involving language tags as they are needed in a variety of protocols and applications.

Please see the "See Also" references for a thorough explanation of how to correctly use language tags.


I've considered making all the above functions that output language tags return all those tags strictly in lowercase. Having all your language tags in lowercase does make some things easier. But you might as well just lowercase as you like, or call encode_language_tag($lang1) where appropriate.


In some future version of I18N::LangTags, I plan to include support for RFC2482-style language tags -- which are basically just normal language tags with their ASCII characters shifted into Plane 14.


* I18N::LangTags::List

* RFC 3066,, "Tags for the Identification of Languages". (Obsoletes RFC 1766)

* RFC 2277,, "IETF Policy on Character Sets and Languages".

* RFC 2231,, "MIME Parameter Value and Encoded Word Extensions: Character Sets, Languages, and Continuations".

* RFC 2482,, "Language Tagging in Unicode Plain Text".

* Locale::Codes, in

* ISO 639-2, "Codes for the representation of names of languages", including two-letter and three-letter codes,

* The IANA list of registered languages (hopefully up-to-date),


Copyright (c) 1998+ Sean M. Burke. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The programs and documentation in this dist are distributed in the hope that they will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.


Sean M. Burke