perl-5.38.0
fc EXPR
fc

Returns the casefolded version of EXPR. This is the internal function implementing the \F escape in double-quoted strings.

EXPR の畳み込み版を返します。 これは、ダブルクォート文字列における、\F エスケープを 実装する内部関数です。

Casefolding is the process of mapping strings to a form where case differences are erased; comparing two strings in their casefolded form is effectively a way of asking if two strings are equal, regardless of case.

畳み込みは大文字小文字の違いを消した形式に文字列をマッピングする処理です; 畳み込み形式で二つの文字列を比較するのは二つの文字列が大文字小文字に 関わらず等しいかどうかを比較する効率的な方法です。

Roughly, if you ever found yourself writing this

おおよそ、自分自身で以下のように書いていたとしても

    lc($this) eq lc($that)    # Wrong!
        # or
    uc($this) eq uc($that)    # Also wrong!
        # or
    $this =~ /^\Q$that\E\z/i  # Right!

Now you can write

今では以下のように書けます

    fc($this) eq fc($that)

And get the correct results.

そして正しい結果を得られます。

Perl only implements the full form of casefolding, but you can access the simple folds using "casefold()" in Unicode::UCD and "prop_invmap()" in Unicode::UCD. For further information on casefolding, refer to the Unicode Standard, specifically sections 3.13 Default Case Operations, 4.2 Case-Normative, and 5.18 Case Mappings, available at https://www.unicode.org/versions/latest/, as well as the Case Charts available at https://www.unicode.org/charts/case/.

Perl は完全な形式の畳み込みのみを実装していますが、 "casefold()" in Unicode::UCD"prop_invmap()" in Unicode::UCD を使って 単純なたたみ込みにアクセスできます。 畳み込みに関するさらなる情報については、 https://www.unicode.org/versions/latest/ で利用可能な Unicode 標準、特に 3.13 Default Case Operations, 4.2 Case-Normative, 5.18 Case Mappings および、https://www.unicode.org/charts/case/ で 利用可能なケース表を参照してください。

If EXPR is omitted, uses $_.

EXPR が省略されると、$_ を使います。

This function behaves the same way under various pragmas, such as within "use feature 'unicode_strings", as lc does, with the single exception of fc of LATIN CAPITAL LETTER SHARP S (U+1E9E) within the scope of use locale. The foldcase of this character would normally be "ss", but as explained in the lc section, case changes that cross the 255/256 boundary are problematic under locales, and are hence prohibited. Therefore, this function under locale returns instead the string "\x{17F}\x{17F}", which is the LATIN SMALL LETTER LONG S. Since that character itself folds to "s", the string of two of them together should be equivalent to a single U+1E9E when foldcased.

この関数は、 "use feature 'unicode_strings" のようなさまざまなプラグマの影響下では、lc と同様に 振る舞います; 但し、use locale のスコープ内での LATIN CAPITAL LETTER SHARP S (U+1E9E) の fc は例外です。 この文字の畳み込み文字は普通は "ss" ですが、lc の節で 説明しているように、ロケールの基での255/256 境界をまたぐ大文字小文字の変更は 問題があるので、禁止されています。 従って、ロケールの基ではこの関数は代わりに LATIN SMALL LETTER LONG S である "\x{17F}\x{17F}" を返します。 この文字自体は "s" の畳み込みなので、これら二つを合わせた文字列は 畳み込まれた場合は単一の U+1E9E と等価になります。

While the Unicode Standard defines two additional forms of casefolding, one for Turkic languages and one that never maps one character into multiple characters, these are not provided by the Perl core. However, the CPAN module Unicode::Casing may be used to provide an implementation.

Unicode 標準はさらに二つの畳み込み形式、一つはツルキ語、もう一つは決して 一つの文字が複数の文字にマッピングされないもの、を定義していますが、 これらは Perl コアでは提供されません。 しかし、CPAN モジュール Unicode::Casing が実装を 提供しています。

fc is available only if the "fc" feature is enabled or if it is prefixed with CORE::. The "fc" feature is enabled automatically with a use v5.16 (or higher) declaration in the current scope.

fc"fc" 機能 が有効か CORE:: が前置されたときにのみ利用可能です。 "fc" 機能 は現在のスコープで use v5.16 (またはそれ以上) が宣言されると自動的に有効になります。