Internationalization and localization tools


Locale-Sensitive Perl Method

lc EXPR

Internationalization (I18n) Method Overview

The lc function returns a lowercased version of EXPR. This is the internal function implementation of the \L escape in double-quoted strings.

See perl's lc function documentation for additional details.

I18n Issues

Case changes that cross Unicode 255/256 boundary are not well defined prior to perl v5.20, or for non UTF-8 locales. For example, LATIN CAPITAL LETTER SHARP S (U+1E9E) should lowercase convert to U+00DF on ASCII platforms. However, perl has no way to know if the current locale contains U+00DF. So the lc of LATIN CAPITAL LETTER SHARP S is itself. As of perl v5.20, perl does now support full Unicode case change rules for UTF-8 locales.

Additionally, many locales do not contain the concept of case changes. Do not rely on or expect this functionality.

Suggested Replacement

Ideally, use only UTF-8 locales and at least perl v5.20. If possible, perl v5.22 is desirable. It will provide some error checking, and warn if the 255/256 barrier is crossed.

Do not assume that all locales will support case changes. Do not make logical assumptions based on whether a case change occurs.

Globalyzer will detect this function and report it as an i18n issue. If you have determined that the call is being handled correctly, you can use Globalyzer's Ignore Comment functionality to ensure that it isn't picked up in a subsequent scan.



Locale-Sensitive Perl Methods

 

Lingoport internationalization and localization services and software