Редагувати

Поділитися через


CultureInfo.GetCultureInfoByIetfLanguageTag(String) Method

Definition

Deprecated. Retrieves a read-only CultureInfo object having linguistic characteristics that are identified by the specified RFC 4646 language tag.

public:
 static System::Globalization::CultureInfo ^ GetCultureInfoByIetfLanguageTag(System::String ^ name);
public static System.Globalization.CultureInfo GetCultureInfoByIetfLanguageTag (string name);
static member GetCultureInfoByIetfLanguageTag : string -> System.Globalization.CultureInfo
Public Shared Function GetCultureInfoByIetfLanguageTag (name As String) As CultureInfo

Parameters

name
String

The name of a language as specified by the RFC 4646 standard.

Returns

A read-only CultureInfo object.

Exceptions

name is null.

name does not correspond to a supported culture.

Remarks

Note

This method and the IetfLanguageTag property are deprecated. Instead of using these APIs, we recommend using the CultureInfo constructors, CultureInfo.GetCultureInfo, and the Name property. IETF tags and names are identical.

The RFC 4646 standard that is maintained by the Internet Engineering Task Force (IETF) defines an IETF language tag, which provides a uniform means of identifying a language. The format of an IETF language tag is the same as the culture name returned by the Name property, but does not identify a culture uniquely. Different cultures share the same IETF language tag if those cultures have identical linguistic characteristics. The linguistic characteristics of a culture are contained in the TextInfo object associated with a CultureInfo object.

An IETF language tag consists of a mandatory language identifier, an optional script identifier, and an optional region identifier.

Your applications should use the retrieved culture to control language-specific tasks, such as managing a spelling or grammar checker. Applications should not use the retrieved culture to control culture-specific tasks, such as sorting text or formatting times and dates.

For more information, see RFC 4646 - "Tags for Identifying Languages.

Notes to Callers

.NET Framework 3.5 and earlier versions throw an ArgumentException if name does not correspond to the name of a supported culture. Starting with .NET Framework 4, this method throws a CultureNotFoundException.

Applies to

See also