GlyphID reverse lookup to get Unicode characters

In my plug-in I have a GlyphID extracted from an IPMFont* but the glyph does not have a unicode value because it is a ligature, a combination of many unicode characters. Is there a way I can query the IPMFont* object to find out what unicode characters need to be used to convert to this ligature. In a TrueType font this information would be held in the 'GSUB' (Glyph SUBstitution) table.
a simple example of this would be:
'f' + 'f' + 'i' = 'ffi'
'1' + '/' + '2' = '½'
So the glyphID I have would be the 'ffi' or the '½' glyph and I need to find out the 3 unicode characters which, when used in combination, would cause that glyph to be used.
This is then extended to Arabic and Hindi fonts where the Ligatures are highly important in drawing the script correctly.
Using Utils<IGlyphUtils>->GlyphToCharacter (font, glyph, &userAreaChar) does not work as the glyph has no Unicode character representation so the function just returns 0.
Likewise Utils<IGlyphUtils>->GetUnicodeForGlyphID (font, glyph) gives the same result

IGlyphUtils.h might be useful but I have yet to discover a routine that gives me the information I need.
Do I have to use glyphUtils->GetOTFAttribute and iterate through it to find which combination of unicode characters result in a particular glyphID? And what parameters should I use for GetOTFAttribute to get the ligature table?

Similar Messages

  • How do I get unicode characters out of an oracle.xdb.XMLType in Java?

    The subject says it all. Something that should be simple and error free. Here's the code...
    String xml = new String("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<x>\u2026</x>\n");
    XMLType xmlType = new XMLType(conn, xml);
    conn is an oci8 connection.
    How do I get the original string back out of xmlType? I've tried xmlType.getClobVal() and xmlType.getString() but these change my \u2026 to 191 (question mark). I've tried xmlType.getBlobVal(CharacterSet.UNICODE_2_CHARSET).getBytes() (and substituted CharacterSet.UNICODE_2_CHARSET with a number of different CharacterSet values), but while the unicode characters are encoded correctly the blob returned has two bytes cut off the end for every unicode character contained in the original string.
    I just need one method that actually works.
    I'm using Oracle release I'd mention NLS_LANG and file.encoding, but I'm setting the PrintStream I'm using for output explicitly to UTF-8 so these shouldn't, I think, have any bearing on the question.
    Thanks for your time.
    Stryder, aka Ralph

    I created analogic test case, and executed it with DB (Linux x86), which seems to work fine.
    Please refer to the execution procedure below:
    * I used AL32UTF8 database.
    1. Create simple test case by executing the following SQL script from SQL*Plus:
    connect / as sysdba
    create user testxml identified by testxml;
    grant connect, resource to testxml;
    connect testxml/testxml
    create table testtab (xml xmltype) ;
    insert into testtab values (xmltype('<?xml version="1.0" encoding="UTF-8"?>'||chr(10)||'<x>'||unistr('\2026')||'</x>'||chr(10)));
    -- chr(10) is a linefeed code.
    2. Create as follows:
    import java.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.*;
    import oracle.xdb.XMLType;
    import java.util.*;
    public class QueryXMLType
         public static void main(String[] args) throws Exception, SQLException
              DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
              OracleConnection conn = (OracleConnection) DriverManager.getConnection("jdbc:oracle:oci8:@localhost:1521:orcl", "testxml", "testxml");
              OraclePreparedStatement stmt = (OraclePreparedStatement)conn.prepareStatement("select xml from testtab");
              ResultSet rs = stmt.executeQuery();
              OracleResultSet orset = (OracleResultSet) rs;
              while (
                   XMLType xml = XMLType.createXML(orset.getOPAQUE(1));
    3. Compile and execute QueryXMLType.class as follows:
    export PATH=$ORACLE_HOME/jdk/bin:$PATH
    export CLASSPATH=.:$ORACLE_HOME/jdbc/lib/ojdbc5.jar:$ORACLE_HOME/jlib/orai18n.jar:$ORACLE_HOME/rdbms/jlib/xdb.jar:$ORACLE_HOME/lib/xmlparserv2.jar
    java QueryXMLType
    -> Then you will see U+2026 character (horizontal ellipsis) is properly output.
    My Java code came from "Oracle XML DB Developer's Guide 11g Release 1 (11.1) Part Number B28369-04" with some modification of:
    - Example 14-1 XMLType Java: Using JDBC to Query an XMLType Table
    - Example 18-23 Using XQuery with JDBC

  • IP reverse lookup slow

    I�m trying to create a socket by using the constructor
    new Socket(host, port)
    where the host can be a hostname like or a textual representation of an IP.
    When creating this socket using a textual representation of an IP and the port the jvm makes a reverse lookup to get the real hostname for that IP. If the reverse lookup failes
    (there is no hostname connected to this IP) the creation of the socket takes 5-10 seconds.
    How can I prevent the socket from doing this lookup?
    My application makes HTTP requests to an IP with no revers lookup hostname.
    Bad performance because of the lookup is my big problem here....

    There are ISPs out there who don't give reverse lookups; convincing all of them to fix their DNS is a pretty big task...
    Here is one horrible hack that seems to get around the reverse lookup:
    new Socket(InetAddress.getByAddress("", new byte[] { 10, 10, 10, 12 }), 80);
    You'd have to write or find a numeric address -> byte[] parser. Extra credit for handling IPv6 addresses. getByAddress() exists from JDK 1.4 onwards.
    I hope someone comes up with a better way. Or unzip in the JDK and rummage around, and related to see if you find a way.

  • Initialising strings with unicode characters

    This works
    System.out.println("Hello World");
    but this will not compile
    How do I get unicode characters into my Java source?
    I am running Windows XP and editing my files using notepad.
    If I save my source as ASCII it compiles, but I do not get the foreign characters.
    If I save my file as utf-8 or unicode the source will not compile.

    I have got it!
    On Windows XP using notepad the java source file can be "saved as" Unicode.
    The source can then be compiled using;
    javac -encoding unicode
    The code compiles and executes.
    It is even possible to give variables names that are Chinese characters, which is really what you would expect to be able to do.

  • Unicode characters not displayed in text property

    I am developing a web application with Flex Builder. I write
    the text for each label using a font called Dhivehi which is
    written from left to right, and then copy the text and paste it in
    the label property called text.
    However in the source code view the text property of the
    label shows
    The issue is that when rendered the text is rversed. So I
    want to run a function once the application is loaded, to reverse
    the text in the label, so that the text will appear in it's
    original way.
    any help will be very much appreciated

    I have a strange problem here with Windows.Forms.RichTextBox, when I assign a .ToString() value of sting builder to a rich text box’s .Rtf Property the Unicode characters containing in string builder gets converted to ???? symbols in .Rtf property of rich
    text box.
    Could you please let me know if Rich text box’s .Rtf property can hold Unicode characters? or is there any other way to store the Unicode characters in rich text box?
    Thanks & Regards,
    To clarify and help you get proper solution, I would recommend you share a rtf string or even a simple sample which could reproduce that issue with us.
    We will based on that sample to help you.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    HERE to participate the survey.

  • Remove Old Name Servers from reverse lookup zones in DNS- PowerShell

    Hello Scripting Guys,
    I'm a long-time fan. Please let me know if I have included enough information for you to provide some guidance. Thank
    Here is what I am attempting to do:
    import a .csv file which contains
    and then delete the name server entries from the reverse lookup zones.
    There are hundreds of zones and 80+ name servers in each for a total of about 25,000 records to be removed. I
    have the list of zones and the list of name servers which I want to remove from the zones.
    I am running PowerShell as a Domain Admin with access to DNS. Zones allow secure updates only (if that matters here).
    I am running it from a Server 2012 R2 server with the DNS admin tools installed against Server 2008 R2 DNS servers. Current AD functional level Windows Server 2003. All DC are DNS server and GC's.
    What I have tried:
    The following
    works to return all the Name Server records in a zone:
    .csv file format
    Import-Module DnsServer
    $PDCE = Get-ADDomainController -Discover -Service PrimaryDC
    import-csv c:\temp\OldNSrecords-test.csv | foreach {
    Get-DnsServerResourceRecord -ZoneName $_.zoneName -RRType "Ns" -computerName $PDCE
    OutPut to screen:
    HostName RecordType Timestamp TimeToLive RecordData
    @ NS 0 1:00:00
    @ NS 0 1:00:00
    However, replacing the business line (in green above after foreach) with the remove command (in red below)
    does not work to delete the specific record listed in the .csv, even though it follows the
    pattern from MS TechNet:
    Remove-DnsServerResourceRecord -ZoneName $_.zoneName -RRType "Ns" -name $_.hostname -computerName
    PS C:\Windows\system32> C:\Temp\OldNSCleanup.ps1
    Remove-DnsServerResourceRecord : Failed to get record in zone on PDCE server.
    At C:\Temp\OldNSCleanup.ps1:4 char:1
    + Remove-DnsServerResourceRecord -ZoneName $_.zoneName -RRType "Ns" -name $ ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (PDCE:root/Microsoft/...rResourceRecord) [Remove-
    DnsServerResourceRecord], CimException
    + FullyQualifiedErrorId : WIN32 9714,Remove-DnsServerResourceRecord​
    When I remove the use of the .csv and put the names of the zone and server in the command, I get the same results.
    It's as if the record does not exist, but I can browse to it in the GUI. I found
    this about Missing Glue records, but it does not seem to apply to reverse lookup NS records. I'm thinking that I need to first load each zone into an assembly and then do the removal,
    but I'm not sure how to do that in PowerShell. I tried piping the get command for the zone to the remove command, but that did not work or I did not have the correct syntax.
    I have attempted to use DNSCMD to do the same and that command appears to work, but then fails to actually remove
    the record.
    Here is an example of that command:
    import-csv C:\Temp\OldNSrecords-test.csv | foreach {dnscmd.exe "" /Recorddelete $_.ZoneName
    $_.hostname $_.recordType /f}
    Deleted Ns record(s) at
    Command completed successfully. [But not really, the NS record is still there]
    I have researched several sites including the suggest one here, but this does not fit my requirement.

    Here is a backing store for the root servers in the DNS format:
    ; formerly NS.INTERNIC.NET
    . 3600000 IN NS A.ROOT-SERVERS.NET.
    A.ROOT-SERVERS.NET. 3600000 A
    ; formerly NS1.ISI.EDU
    . 3600000 NS B.ROOT-SERVERS.NET.
    B.ROOT-SERVERS.NET. 3600000 A
    ; formerly C.PSI.NET
    . 3600000 NS C.ROOT-SERVERS.NET.
    C.ROOT-SERVERS.NET. 3600000 A
    ; formerly TERP.UMD.EDU
    . 3600000 NS D.ROOT-SERVERS.NET.
    D.ROOT-SERVERS.NET. 3600000 A
    ; formerly NS.NASA.GOV
    . 3600000 NS E.ROOT-SERVERS.NET.
    E.ROOT-SERVERS.NET. 3600000 A
    ; formerly NS.ISC.ORG
    . 3600000 NS F.ROOT-SERVERS.NET.
    F.ROOT-SERVERS.NET. 3600000 A
    ; formerly NS.NIC.DDN.MIL
    . 3600000 NS G.ROOT-SERVERS.NET.
    G.ROOT-SERVERS.NET. 3600000 A
    ; formerly AOS.ARL.ARMY.MIL
    . 3600000 NS H.ROOT-SERVERS.NE
    Notice that each is a pair.
    One is the NS and the secon is the A record.
    .                        3600000      NS    G.ROOT-SERVERS.NET.
    G.ROOT-SERVERS.NET.      3600000      A
    In this case the dot represents the self reference to the A record.  These are the records that bootstrap all of the Internet.  Remove them and you ae lost.
    The CSV uses the @ to anchor the local domain.  Perhaps the DNS CmdLets prefer the dot.  The @ is what appears on the screen when we use the GUI. Note the dot at the end of the FQDN.  It is required.  Even browser use
    it but they add it if you forget.

  • How to do a reverse lookup on a value set?

    I have a concurrent program which has multiple paramaters with various value sets. When I run reports, I want to dynamically list on the output the parameters the user gave. The problem is that these values are often the IDs and not the value the user sees.
    Are there any packages in applications that will let me to do a "reverse lookup" with the value sets to get the values the user saw?

    Hi Stomie,
    Based on your description, the network ID of your reverse lookup zone is 172.16.160.
    To create a reverse lookup zone, please follow steps below,
    Right click Reverse Lookup Zones, click New Zone, choose proper settings of
    Zone Type, Active Directory one Replication Scope,
    Reverse Lookup Zone Name type based on your actual situation.
    In the Reverse Lookup Zone Name page, check Network ID
    radio button, enter the network ID. For example, if the network ID is 172.16.160, then enter 172, 16, 160 in order. Then you will see it appears in the Reverse lookup zone name edit.
    Or in the Reverse Lookup Zone Name page, check
    Reverse lookup zone name radio button, then enter the name of the reverse lookup zone directly. Such as, enter in the edit.
    Click Next twice, click Finish.
    Reverse lookup zone name end up with
    Best Regards,

  • How do I get Unicode chars beyond the ASCII range to display ?

    Hello all.
    I have just recently started to learn Java.
    I want to display the data in a array using Unicode characters, but when I use the unicode code from the code sheet I merely get a ?.
    I looked about the net and understand that Java doesnt support none ASCII characters (by default?) , I think its possible to import various codes but not sure about that.
    My question is: How do I get the Unicode character 2254 Box Drawing Element to display (also other non standard ASCII ) ? Print("\u2254") results in a ?.
    If you are wondering why:
    I want to store a map for a game into a data array with the entities represented as normal letters and characters, this map will be generated by the program randomly but I want to see the output of the map to test if its obeying the rules I set out for the map generation.
    I figured just read the array and print out the result , but to make it more legible in debugging convert the text characters to box drawing characters.

    Both methods you mentioned just generate a question mark instead of the box drawing element I want.
    I can get all the normal, ie letters and numbers and the common characters... but beyond that and all I get is a '?' in its place.
    Initially I just wanted it to print the character in the legend.
    The code below just prints a few lines of text , the legend to decipher the level display, and calls a class to create a level ..then the last call is to call a debug class to display the level that was created.
    *   Prelim Code for the Random Dungeon Generator       *
    *   used in Dungeon Runner                             *
    *   Created : 03/07/2009                               *
    public class DungeonGenerator {
          public static void main (String[] args) {
               "Prelimary code for the Random Dungeon Generator for Dungeon Runner Game\n\n"
                                   );                    // Just a text heading reminder for me
               "Test 1 - debug screen - 03 July 2009\n\n"
          System.out.println("Legend: \u2254 = Top Left Corner \t 2 = Top Right Corner");
          System.out.println("        3 = Bot Left Corner \t 4 = Bot Right Corner");
          System.out.println("        L = Left Wall \t\t R = Right Wall");
          System.out.println("        T = Top Wall \t\t B = Bottom Wall");
          System.out.println("        D = Doorway \t\t + = Play Space");
          System.out.println("        E = Exit Entity \t S = Start Entity");
          System.out.println("        . = None Play Space");
         // Call the LevelGen
         /** This is just a temperary call method
              I am will use another array and a
              loop to call the LevelGen the
              number of levels I decide the
              game will have
         LevelGen levelone = new LevelGen();          // Calls the LevelGen to create a Level
         levelone.displayLevel();                    // Display the level that was generated
                                                 // for debugging only
          }     // End Main method
    }      // End DungeonGenerator class

  • Insert Unicode Characters Into Oracle 8.1.5

    First off, here are the specs:
    Oracle 8.1.5
    JDK 1.2.1
    Oracle8i JDBC Drivers for use with JDK 1.2.x for Solaris
    I'm running into a problem with insert Unicode characters into Oracle via the JDBC driver. As you can see above, I am using the Oracle JDBC driver because it is the first driver with supports the JDK 1.2.x. So I think I should be okay.
    I can retrieve data with special characters from Oracle by calling the getBytes() method from the ResultSet with all special characters being intact. I am using getBytes because calling getString() would throw the following exception: "java.sql.SQLException(): Fail to convert between UTF8 and UCS2: failUTF8Conv". However, with that value that I just retrieved, or any other data with special characters (unicode) in which I try to insert into Oracle does not get converted properly.
    What appears to be happening is that data with special characters (unicode), are not being treated as a single double byte character, but rather two single byte characters. Thus, R|ckschlagventil becomes RC<ckschlagventil once it is inserted. (Hopefully, my example will be rendered properly).
    According to all documentation that I have found, the JDBC driver should not have any problem with converting UCS2 Java Strings to Oracle's UTF8 character set.
    I have set Oracle's NLS_NCHAR_CHARACTERSET to UTF8. I am also setting the environment variable NLS_LANG to AMERICAN_AMERICA.UTF8. Perhaps there is some other environment setting in which I am missing?
    Any help would be appreciated,

    Import has a lot of options, so it depends on what you want to do.
    C:\> imp help=y
    will show you all possible options. An example of full import :
    C:\> imp <username>/<password>@<TNS alias> file=<DMP file> full=y log=<LOG file>
    Message was edited by:
    Paul M.
    ...and there is always [url]The documentation

  • How to Install DNS ROLE and its FQDN service and Reverse Lookup zone in Server Core using Powershell?

    I am Setting A Lab Scenario That the PC name "Core2012" i.e. Server Core 2012 Will be Domain Controller.
    Using PowerShell I have done this Task
    Change hostname ; Configure IP address and Preferred DNS address ; Disable IPv6 ;
    Configure Firewall ; Even Active Directory Role install.
    Now problem occur
    Well I have know to install DNS role install-WindowsFeature DNS
    How to configure FQDN ; Restore mode password ; Setting up global catalog server ;and configure Reverse Lookup zone Using powershell
    I have search many Forums but I am not getting to touch with it.
    So I Need a help to set and Configure DNS using Powershell
    Thank You!!!

    Hi Sagarpdalvi,
    To set the Safe mode password with powershell, please refer to the cmdlet Install-ADDSDomainController, to enable global catalog(GC), please run the cmdlet "Set-ADObject" after install Active Directory on the core server, to configure Reverse Lookup zone,
    please refer to the cmdlet
    To configure DC with powershell, please check the scripts:
    Installing a Domain Controller on Windows Server 2012
    R2 Core
    Enabling and Disabling the Global Catalog
    To configure DNS, the Domain Name System (DNS) Server Cmdlets should be helpful for you:
    I hope this helps.

  • Scanning files for non-unicode characters.

    Question: I have a web application that allows users to take data, enter it into a webapp, and generate an xml file on the servers filesystem containing the entered data. The code to this application cannot be altered (outside vendor). I have a second webapp, written by yours truly, that has to parse through these xml files to build a dataset used elsewhere.
    Unfortunately I'm having a serious problem. Many of the web applications users are apparently cutting and pasting their information from other sources (frequently MS Word) and in the process are embedding non-unicode characters in the XML files. When my application attempts to open these files (using DocumentBuilder), I get a SAXParseException "Document root element is missing".
    I'm sure others have run into this sort of thing, so I'm trying to figure out the best way to tackle this problem. Obviously I'm going to have to start pre-scanning the files for invalid characters, but finding an efficient method for doing so has proven to be a challenge. I can load the file into a String array and search it character per character, but that is both extremely slow (we're talking thousands of LONG XML files), and would require that I predefine the invalid characters (so anything new would slip through).
    I'm hoping there's a faster, easier way to do this that I'm just not familiar with or have found elsewhere.

    require that I predefine the invalid charactersThis isn't hard to do and it isn't subject to change. The XML recommendation tells you here exactly what characters are valid in XML documents.
    However if your problems extend to the sort of case where users paste code including the "&" character into a text node without escaping it properly, or they drop in MS Word "smart quotes" in the incorrect encoding, then I think you'll just have to face up to the fact that allowing naive users to generate uncontrolled wannabe-XML documents is not really a viable idea.

  • The JSP WYSIWYG Editor can't display most Unicode characters

    Eclipse supports display of Unicode characters very well since version 3. However, NitroX couldn't display most most of them. Well, besides characters from other non-Western European languages, NitroX can't even display characters that it's supposed to support. Well, that's what I think so. I mean, when we type the & character, we have the whole list of character entity references amongst which we could find &and; &nabla; &or; &rarr; but which are not displayed correctly. And many more are in this case.
    Is this a feature or a bug? By "feature", it means that we can't get them in free version.

    I have exactly the same problem. I support web pages for 25 European countries. I've not seen Nitrox support any unicode characters. Until M7 answers this question or fixes the editor, you can use the Eclipse editor to see and edit the text.

  • Direct Execution of query having Unicode Characters

    Direct Execution of query having Unicode Characters
    Hi All,
    In my application I am firing a Select Query having Unicode characters in Where Clause under condition like '%%'
    to Oracle 10g DB from a Interface written in VC6.0...
    Application funcationality is working fine for ANSI characters and getting the result of Select properly.
    But in case of Unicode Characters in VC it says 'No Data Found'.
    I know where the exact problem is in my code. But not getting the exact solution for resolving my issue...
    Here with I am adding my code snippet with the comments of what i understand and what i want to understand...
    DBPROCESS Structure used in the functions,_
    typedef struct
    HENV hEnv;
    HDBC hDbc;
    HSTMT hStmt;
    char CmdBuff[[8192]];
    char RpcParamName[[255]];
    SQLINTEGER ColIndPtr[[255]];
    SQLINTEGER ParamIndPtr[[255]];
    SQLPOINTER pOutputParam;
    SQLUSMALLINT CurrentParamNo;
    SQLUSMALLINT OutputParamNo;
    SQLUSMALLINT InputParamCtr;
    SQLINTEGER BatchStmtNo;
    SQLINTEGER CmdBuffLen;
    short CurrentStmtType;
    SQLRETURN LastStmtRetcode;
    SQLCHAR SqlState[[10]];
    int ShowDebug;
    SQLCHAR* ParameterValuePtr;
    int ColumnSize;
    DBTYPE DatabaseType;
    DRVTYPE OdbcDriverType;
    BLOCKBIND *ptrBlockBind;
    BOOL CDynamicPickList::GetResultSet(DBPROCESS *pDBProc, bstrt& pQuery, short pNumOdbcBindParams, COdbcBindParameter pOdbcBindParams[], CQueryResultSet& pQueryResultSet)
         int               lRetVal,
         bstrt               lResultSet;
         wchar_t               lColName[[256]];     
         SQLUINTEGER          lColSize;
         SQLSMALLINT          lColNameLen,
         wchar_t               lResultRow[[32]][[256]];
    OdbcCmdW(pDBProc, (wchar_t *)pQuery); *//Query is perfectly fine till this point all the Unicode Characters are preserved...*
         if ( OdbcSqlExec(pDBProc) != SUCCEED )
              LogAppError(L"Error In Executing Query %s", (wchar_t *)pQuery);          
              return FALSE;
    Function OdbcCmdW_
    //From this point have no idea what is exactly happening to the Unicode Characters...
    //Actually i have try printing the query that gets stored in CmdBuff... it show junk for Unicode Characters...
    //CmdBuff is the Char type Variable and hence must be showing junk for Unicode data
    //I have also try printing the HexaDecimal of the query... I m not getting the proper output... But till i Understand, I think the HexaDecimal Value is perfect & preserved
    //After the execution of this function the call goes to OdbcSqlExec where actual execution of qurey takes place on DB
    SQLRETURN OdbcCmdW( DBPROCESS p_ptr_dbproc, WCHAR      p_sql_command )
         char *p_sql_commandMBCS;
         int l_ret_val;
         int l_size = wcslen(p_sql_command);
         int l_org_length,
    p_sql_commandMBCS = (char *)calloc(sizeof(char) * MAX_CMD_BUFF,1);
    l_ret_val = WideCharToMultiByte(
                        NULL,                         // performance and mapping flags
                        p_sql_command,          // wide-character string
                        -1,                         // number of chars in string
                        (LPSTR)p_sql_commandMBCS,// buffer for new string
                        MAX_CMD_BUFF,                    // size of buffer
                        NULL, // default for unmappable chars
                        NULL // set when default char used
    l_org_length = p_ptr_dbproc->CmdBuffLen;
    l_newcmd_length = strlen(p_sql_commandMBCS);
    p_ptr_dbproc->CmdBuff[[l_org_length]] = '\0';
    if( l_org_length )
    if( (l_org_length + l_newcmd_length) >= MAX_CMD_BUFF )
    if( l_org_length == 0 )
    OdbcReuseStmtHandle( p_ptr_dbproc );
    strcat(p_ptr_dbproc->CmdBuff, " ");
         l_org_length +=2;
    strcat(p_ptr_dbproc->CmdBuff, p_sql_commandMBCS);
    p_ptr_dbproc->CmdBuffLen = l_org_length + l_newcmd_length;
    if (p_sql_commandMBCS != NULL)
    return( SUCCEED );
    Function OdbcSqlExec_
    //SQLExecDirect Requires data of Unsigned Char type. Thus the above process is valid...
    //But i am not getting what is the exact problem...
    SQLRETURN OdbcSqlExec( DBPROCESS *p_ptr_dbproc )
    SQLRETURN l_ret_val;
    SQLINTEGER l_db_error_code=0;
         int     i,l_occur = 1;
         char     *token_list[[50]][[2]] =
    {     /*"to_date(","convert(datetime,",
                                       "'yyyy-mm-dd hh24:mi:ss'","1",*/
                                       "nvl","isnull" ,
                                       "sysdate",     "getdate()",
                                       "format_date", "dbo.format_date",
                                       "format_amount", "dbo.format_amount",
                                       "to_date", "dbo.to_date",
    char          *l_qry_lwr;  
    l_qry_lwr = (char *)calloc(sizeof(char) * (MAX_CMD_BUFF), 1);
    l_ret_val = SQLExecDirect( p_ptr_dbproc->hStmt,
    (SQLCHAR *)p_ptr_dbproc->CmdBuff,
    SQL_NTS );
    switch( l_ret_val )
    case SQL_SUCCESS :
    case SQL_NO_DATA :
    ClearCmdBuff( p_ptr_dbproc );
    p_ptr_dbproc->LastStmtRetcode = l_ret_val;
    if (l_qry_lwr != NULL)
    return( SUCCEED );
    case SQL_NEED_DATA :
    case SQL_ERROR :
    I do not see much issue in the code... The process flow is quite valid...
    But now i am not getting whether,
    1) storing the string in CmdBuff is creating issue
    2) SQLExecDirect si creating an issue(and some other function can be used here)...
    3) Odbc Driver creating an issue and want some Client Setting to be done(though i have tried doing some permutation combination)...
    Any kind of help would be appreciated,
    Thanks & Regards,
    Edited by: prats on Feb 27, 2009 12:57 PM

    Hey Sergiusz,
    You were bang on target...
    Though it took some time for me to resolve the issue...
    to use SQLExecDirectW I need my query in SQLWCHAR *, which is stored in char * in my case...
    So i converted the incoming query using MultibyteToWideChar Conversion with CodePage as CP_UTF8 and
    then passed it on to SQLExecDirectW...
    It solved my problem
    Edited by: prats on Mar 3, 2009 2:41 PM

  • What table column size is needed to accomodate Unicode characters

    Hi guys,
    I have encounter something which i dont understand and i hope gurus here will shed some light on me.
    I am running a non-unicode database and i decided to port the data over to a unicode database.
    1) i export the schema out --> data.dmp
    2) then i create the unicode database + create a user
    3) then i import the schema into the database
    during the imp i can see that character conversion will take place.
    During importing of data into the unicode database
    I encounter some error
    saying column size is too small
    so i went to check the row that has the column value that is too large to fit in the table.
    I realise it has some [][][][] data.. so i went to the live non-unicode database and find the row. Indeed it has some [][][][] rubbish data which i feel that someone has inserted other language then english into the database.
    But regardless,
    I went to modify the column size to a larger size, now the row can be accommodated. However the data is still [][][].
    q1) why so ? since now my database is unicode, during the import, this column data [][][] should be converted to unicode already but i still have problem seeing what language it is.
    q2) why at the non-unicode database, the [][][] data can fit into the table column size, but on unicode database, the same table column size need to be increase ?
    q3) while doing more research on unicode, it was said that unicode character takes up 2 byte per character. Alot of my table data are exactly the same size of the table column size.
    E.g Name VARCHAR2(5);
    value - 'Peter'
    Now if converting to unicode, characters will take 2byte instead of 1, isnt 'PETER' going to take up 10byte ( 2 byte per character ),
    why is it that i can still accomodate the data into the table column ?
    q4) now with unicode database up, i will be supporting different language characters around the world. How big should i set my column size to ? the longest a name can get ? or ?
    Thanks guys!

    /// does oracle automatically "look" at the each and individual characters in a word and determine how much byte it should take.
    Characters usually originate from a keyboard, which has an associated keyboard layout and an associated character set encoding (a.k.a code page, a.k.a. encoding). This means, the keyboard driver knows that when a key with a letter "á" on it is pressed on a French keyboard, and the associated character set encoding is MS Code Page 1252 (Oracle name WE8MSWIN1252), then one byte with the value 225 is generated. If the associated character set encoding is UTF-16LE (standard internal Windows encoding), two bytes 225 and 0 are generated. When the generated bytes travel through APIs, they may undergo character set conversions from one encoding to another encoding. The conversion algorithms use translation tables to find out how to translate given byte sequence from one encoding to another encoding. In case of translation from WE8MSWIN1252 to AL32UTF8, Oracle will know that the byte sequence resulting from conversion of the code 225 should be 195 followed by 161. For a Chinese characters, for example when converting it from ZHS16GBK, Oracle knows the resulting sequence as well, and this sequence is usually 3 bytes.
    This is how AL32UTF8 data gets into a database. Now, when Oracle processes a multibyte string, and needs to look at individual characters, for example to count them with LENGTH, or take a substring with SUBSTR, it uses information it has about the structure of the character set. Multibyte character sets are of two type: fixed-width and variable-width. Currently, Oracle supports only one fixed-width multibyte character set in the database: AL16UTF16, which is Oracle's name for Unicode UTF-16BE encoding. It supports this character set for NCHAR/NVARCHAR2/NCLOB data types only. This character set uses two bytes per each character code. To find the next code, 2 is simply added to the string pointer.
    All other Oracle multibyte character sets are variable-width character sets, including AL32UTF8. In most cases, the length of each character code can be determined by looking at its first byte. In AL32UTF8, the number of 1-bits in the most significant positions in the first byte before the first 0-bit tells how many bytes a character has. 0 such bits means 1 byte (such codes are identical to 7-bit ASCII), 2 such bits mean two bytes, 3 bits mean 3 bytes, 4 bits mean four bytes. 1 bit (e.g. the bit sequence 10) starts each second, third or fourth byte of a code.
    In other ASCII-based multibyte character sets, the number of bytes is usually determined by the value range of the first byte. Bytes below 128 means a one-byte code, bytes above 128 begin a two- or three-byte sequence, depending on the range.
    There are also EBCDIC-based (mainframe) multibyte character sets, a.k.a shift-sensitive character sets, where a sequence of two-byte codes is introduced by inserting the SO character (code 14=0x0e) and ended by inserting the SI character (code 15=0x0f). There are also character sets, like ISO-2022-JP, which use more complicated byte sequences to define the length and meaning of byte sequences but Oracle supports them only in limited number of places.
    /// e.g i have a word with 4 character. the 3rd character will be a chinese character..the rest are ascii character
    /// will oracle use 4 byte per character regardless its ascii(english) or chinese
    /// or it will use 1 byte per english character then 3 byte for the chinese character ? - 6 bytes taken
    It will use 6 bytes.

  • FOI Servlet non-unicode characters cannot be processed

    I'm using Oracle MapViewer quickstart kit to test some map features
    my database is in CL8MSWIN1251 charset
    I made a simple map application to display some data using JavaScript API
    when I define a theme based FOI layer in the map and the predefined theme has some non-Unicode characters in the labeling or in hidden info fields I get the folowing error:
    Cannot process the following response from FOI server:
    As you can see "\u422\u414" shoud be "\u0422\u0414" otherwise JavaScript cannot display characters in the right way. I think FOIServlet is the problem here.
    Anyone has the same problems or has a solution for this problem pls

    require that I predefine the invalid charactersThis isn't hard to do and it isn't subject to change. The XML recommendation tells you here exactly what characters are valid in XML documents.
    However if your problems extend to the sort of case where users paste code including the "&" character into a text node without escaping it properly, or they drop in MS Word "smart quotes" in the incorrect encoding, then I think you'll just have to face up to the fact that allowing naive users to generate uncontrolled wannabe-XML documents is not really a viable idea.

Maybe you are looking for

  • Problems with refreshing a adf table

    Hi, i am using jdeveloper 11 with the new adf framework. I use a table which i bind to an arraylist. works fine. the table shows the data from the list. at sometime i change the backing arraylist but the table show (only in the section i saw on the s

  • HTML5 tag audio not working in Safari

    I've included a very simply HTML5 script in my webpage like this: <!DOCTYPE HTML> <html> <head> <title>HTML5 Player</title> </head> <body> <audio controls="controls" autoplay="autoplay" <div class="jive-quote"> <source src="

  • Select query with index acess

    Hello, Please give me some code with using index acess ( please high light the index)

  • Gallery and Videos DELETED!!!

    I was taking a picture on my droid x and went into the gallery to look and there were no pictures at all, same for my videos.  I tried shutting the phone off, taking the sd card out and putting it back in, taking the battery out, restoring the galler

  • Balancing iPhoto and Picasa...or do I even need Picasa?

    I use iPhoto for business purposes, taking pictures of all the items I make as a handcrafted jewelry designer. Only use my Coolpix 4500 for this purpose. Recently received a Kodak which I am using for personal picts. What I would LIKE to do is have b