Table of Contents
This chapter briefly introduces the UTL_I18N package, and describes how to use the procedures and functions of the package.
UTL_I18N provides various functions for conversion and compatibility between different countries and languages.
This section describes the functions provided by the UTL_I18N package, in alphabetical order.
Converts RAW data to a string in the current database character set.
Details about the RAW_TO_CHAR function are as follows:
Prototype
UTL_I18N.RAW_TO_CHAR ( data IN RAW, src_charset IN VARCHAR2 ) RETURN VARCHAR2;
Parameter
Parameter | Description |
---|---|
data | Binary data of the input string. |
src_charset | Character set of the input string. |
Example
DECLARE v_in_raw raw(100) := '74696265726F'; x varchar2(100); BEGIN x := UTL_I18N.RAW_TO_CHAR (v_in_raw, 'UTF8'); END;
Converts an input string in the current database character set to binary data in another character set.
Details about the STRING_TO_RAW function are as follows:
Prototype
UTL_I18N.STRING_TO_RAW ( data IN VARCHAR2, dst_charset IN VARCHAR2 ) RETURN RAW;
Parameter
Parameter | Description |
---|---|
data | Input string in the current database character set. |
dst_charset | Destination character set. |
Example
DECLARE v_in_string varchar2(100) := 'sample_string'; x raw(100); BEGIN x := UTL_I18N.STRING_TO_RAW (v_in_string, 'UTF8'); END;
Converts an input string including escape characters to a string excluding the escape characters.
Details about the UNESCAPE_REFERENCE function are as follows:
Prototype
UTL_I18N.UNESCAPE_REFERENCE ( str IN VARCHAR2 ) RETURN VARCHAR2
Parameter
Parameter | Description |
---|---|
str | Input string. |
Example
DECLARE v_in_string varchar2(100) := '<123>'; x varchar2(100); BEGIN x := UTL_I18N.UNESCAPE_REFERENCE (v_in_string); END;