www.openlinksw.com
docs.openlinksw.com

Book Home

Contents
Preface

Virtuoso Functions Guide

Administration
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
Hashing / Cryptographic
LDAP
Locale
charset_define
charset_recode
charsets_list
current_charset
elh_get_handler
elh_load_handler
lh_get_handler
lh_load_handler
Mail
Miscellaneous
Number
RDF data
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web Server & Internet
XML
XPATH & XQUERY

Functions Index

charset_define

Define a character set.
charset_define (in name varchar, in charset_string any, in aliases any);
Description

This function creates a new narrow language-specific character set, or redefines an existing one.

Parameters
name – The name of the character set to define. This becomes the "preferred" name of the character set.
charset_string – Wide string with the character codes for each given character from 1 to 255. That is, a 255-byte long NCHAR defining the Unicode codes for narrow chars 1-255.
aliases – Vector of character set names that are to be aliases of the character set being defined. Use NULL if there are to be no aliases.
Return Types

None

Errors
sqlstate error code error text
2C000 IN001 The UTF-8 is not a redefinable charset
2C000 IN002 charset_define : Charset table not a wide string
2C000 IN003 charset_define : 0 not allowed as a charset definition
2C000 IN004 charset <name> already defined. Drop it first
2C000 IN005 Alias <position> is not of type STRING

Examples
New 4th character, and aliases

To setup the 4th character to be Unicode 0xffce, and give the character set 2 aliases, you would make a call like this:

charset_define ('NEW-CHARSET',
      N'\x1\x2\x3\xffce\x5....' , vector ('SOME-CHARSET', 'ANOTHER-CHARSET'));

The character string should contain 255 wide characters that are arbitrary unicode values.

See Also

charsets_list()