﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Teradata Forums / Drivers and UDFs / Teradata   / Wide character functions (UNICODE) in UDF / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>Teradata Forums</description><link>http://www.teradata.com/teradataforum/</link><webMaster>info@teradata.com</webMaster><lastBuildDate>Thu, 04 Dec 2008 01:36:15 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Wide character functions (UNICODE) in UDF</title><link>http://www.teradata.com/teradataforum/Topic8619-11-1.aspx</link><description>ah yes...quite so - forgot when asking this that the SQL that creates the UDF defines the characterset as LATIN vs UNICODE chars..  I was hoping to right a single UDF that could be made aware internally what characterset was being passed to it - and process it correct - since overloading of the UDF does not take into account characterset...but initial definition locks it down - so its a moot point I guess.</description><pubDate>Tue, 04 Sep 2007 18:07:33 GMT</pubDate><dc:creator>bwenner</dc:creator></item><item><title>RE: Wide character functions (UNICODE) in UDF</title><link>http://www.teradata.com/teradataforum/Topic8619-11-1.aspx</link><description>I assume you mean Unicode since that is the only wide characters set. In Teradata it is a 2 byte character. On MPRAS the native Unicode character is 4 bytes. That is, the C library wide character functions work on 4 byte Unicode strings only. So you can’t use the C library wide character routines directly. You either have to role your own or convert the 2 byte input string to 4 byte character strings and then use the C library wide character functions to manipulate it and vice versa for a return argument.  On Windows the native Unicode character is 2 bytes so you can use the C library wide character routines directly. All other character sets are single byte or use a shift out/in sequence to increase the character set. &lt;br&gt;&lt;br&gt;When your create a UDF you specify with the string parameter in what character set the string argument is to be passed in, just like you would for a column in a table. When the function is called, the string argument, if a different character set from the UDF specification gets converted to the character set for that parameter. The UDF code never has to deal with a character set other than the one it was designed to operate with.  Of course if your UDF defined the parameter to use the Latin character set and you pass it a Unicode column string and the string contains characters outside the Latin character set range you will get a translation error and the request ends. &lt;br&gt;</description><pubDate>Mon, 20 Aug 2007 21:04:43 GMT</pubDate><dc:creator>rgs</dc:creator></item><item><title>Wide character functions (UNICODE) in UDF</title><link>http://www.teradata.com/teradataforum/Topic8619-11-1.aspx</link><description>Does anyone know which wide character functions are available within UDFs written in C?&lt;br&gt;&lt;br&gt;&lt;br&gt;Also, does anyone know if there are variables passed that indicate the characterset of varchars passed to a function?  Since characterset does not trigger function overrides, would be useful to have this information without the user being forced to pass it as a param.</description><pubDate>Mon, 20 Aug 2007 13:09:13 GMT</pubDate><dc:creator>bwenner</dc:creator></item></channel></rss>