Aracılığıyla paylaş


STRCONV( ) Function

Converts character expressions between single-byte, double-byte, UNICODE, and locale-specific representations.

STRCONV(cExpression, nConversionSetting [, nRegionalIdentifier [, nRegionalIDType]])

Parameters

  • cExpression
    Specifies the character expression that STRCONV( ) converts.

  • nConversionSetting
    Specifies the type of conversion. The following table lists the values of nConversionSetting and the type of conversion performed.

    nConversionSetting

    Conversion

    1

    Converts single-byte characters in cExpression to double-byte characters.

    Supported for Locale ID only (specified with the nRegionalIdentifier or nRegionalIDType parameters).

    2

    Converts double-byte characters in cExpression to single-byte characters.

    Supported for Locale ID only (specified with the nRegionalIdentifier or nRegionalIDType parameters).

    3

    Converts double-byte Katakana characters in cExpression to double-byte Hiragana characters.

    Supported for Locale ID only (specified with the nRegionalIdentifier or nRegionalIDType parameters).

    4

    Converts double-byte Hiragana characters in cExpression to double-byte Katakana characters.

    Supported for Locale ID only (specified with the nRegionalIdentifier or nRegionalIDType parameters).

    5

    Converts double-byte characters to UNICODE (wide characters).

    6

    Converts UNICODE (wide characters) to double-byte characters.

    7

    Converts cExpression to locale-specific lowercase.

    Supported for Locale ID only (specified with the nRegionalIdentifier or nRegionalIDType parameters).

    8

    Converts cExpression to locale-specific uppercase.

    Supported for Locale ID only (specified with the nRegionalIdentifier or nRegionalIDType parameters).

    9

    Converts double-byte characters in cExpression to UTF-8

    10

    Converts Unicode characters in cExpression to UTF-8

    11

    Converts UTF-8 characters in cExpression to double-byte characters.

    12

    Converts UTF-8 characters in cExpression to UNICODE characters.

    13

    Converts single-byte characters in cExpression to encoded base64 binary.

    14

    Converts base64 encoded data in cExpression to original unencoded data.

    15

    Converts single-byte characters in cExpression to encoded hexBinary.

    16

    Converts single-byte characters in cExpression to decoded hexBinary.

  • nRegionalIdentifier
    Specifies the Locale ID, code page, or FontCharSet value to use for the conversion. If nRegionalIDType is omitted, the Locale ID is used for the conversion. If nRegionalIdentifier is omitted, the system locale ID is used by default.

    If nRegionalIdentifier is invalid or not supported on the machine, the error "Invalid locale ID" is generated.

    nRegionalIdentifier

    Language

    1029

    Czech

    1031

    German

    1033

    English (Default)

    1034

    Spanish

    1036

    French

    1040

    Italian

    1045

    Polish

    1046

    Portuguese (Brazil)

    2070

    Portuguese (Portugal)

  • nRegionalIDType
    Specifies if a Locale ID, code page, or FontCharSet is used for the conversion.

    The nRegionalIdentifier parameter, described above, is used to specify the actual Locale ID, code page, or FontCharSet used for the conversion.

    nRegionalIDType

    Description

    0

    (Default) Specifies that the nRegionalIdentifier parameter is a Locale ID value.

    1

    Specifies that nRegionalIdentifier is a code page value.

    2

    Specifies that nRegionalIdentifier is a FontCharSet value.

Return Value

Character data type. STRCONV( ) returns the converted character expression.

Remarks

Visual FoxPro disregards invalid characters or incorrect length in base 64- and hexBinary- encoded strings.

This function is useful for manipulating double-byte character sets for languages such as Hiragana and Katakana.

See Also

Reference

CHRTRANC( ) Function

IMESTATUS( ) Function

ISLEADBYTE( ) Function

Other Resources

Functions

Language Reference (Visual FoxPro)