Writing unicode characters on JSwing components

I'm new to computers in general, but how can I write text onto a JTextarea - i need to type into one TextArea in Spanish and in English in the other - can I set up a textarea to be able to write words that include Spanish characters - I've read through most of the forums, but most don't mention this!! please help!!

Hi all,
If we're talking input (as in entering different languages into textfields), it's pretty much down to your operating system if you don't want to spend any money. Windows 2000 is about the only OS I'm aware of that will let you enter non-English languages into textfields off the bat. And even then, you need a foreign version. For instance, the Chinese version of Win2K will let you enter Chinese directly into Java textfields (albeit dodgily due to some pretty bad bugs in the JDK!)
If you're trying to switch input languages between textfields, I doubt the OS could handle it. It sounds to me like it could only be handled by an input method (for those yet to discover this, there is a page or two in the JDK documentation on the Java Input Method Framework). Java supplies the framework only to allow you to enter text in different languages for text components. The problem is that Sun has never supplied its own input methods (I imagine it could blow the JDK's size out quite nicely if they ever tried!). The only input methods out there are sold by third-party developers, but as much as they cost, they are good and reliable. SlangSoft make an excellent one called Spirus which really covers all bases. You can get a thirty-day trial of it at www.slangsoft.com.
Hope that covers it!
Martin Hughes

Similar Messages

  • Writing Unicode characters to scripting parameters on Windows

    I am trying to read/write a file path that supports Unicode characters to/from scripting parameters (PIDescriptorParameters) with an Export plug-in. This works fine on OS X by using AliasHandle together with the "typeAlias" resource type in the "aete" section of the plugin resource file.
    On Windows I am having trouble to make Photoshop correctly display paths with Unicode characters. I have tried:
    - Writing null-terminated char* (Windows-1252) in a "typePath" parameter -- this works but obviously does not support Unicode.
    - Writing null-terminated wchar* (UTF-16) in a "typePath" parameter -- this causes the saved path in the Action palette to be truncated to the first character, caused by null bytes in UTF-16. It appears PS does not understand UTF-16 in this case?
    - Creating an alias record with sPSAlias->WinNewAliasFromWidePath and storing in a "typePath" or "typeAlias" parameter -- this causes the Action palette to show "txtu&", which does not make sense to me at all.
    The question is: what is the correct scripting parameter resource type (typePath, typeAlias, ... ?) for file paths on Windows, and how do I write to it in such way that Photoshop will correctly display Unicode characters in the Actions palette?

    Hi
    Skip the first (4 or 6 characters) and you'll get the Unicode value.
    regards
    Bartek

  • Problems displaying Thai characters in FTE components on Mac

    I had originally posted a question here: http://forums.adobe.com/message/4027591, but was told that this is more of a flash runtime issue.
    I am running into issues displaying Thai characters in Flex components that make use of the Flash Text Engine (FTE), specifically on Mac OSX 10.6.8 Snow Leopard.
    Here's a blurb of my compiler font managers in flex-config.xml:
    <flex-config>
            <target-player>10.2.0</target-player>
            <!-- Specifies the version of the compiled SWF -->
            <swf-version>11</swf-version>
            <compiler>
              <!-- Specifies the locales for internationalization. -->
              <locale>
                  <locale-element>en_US</locale-element>
              </locale>
              <fonts>
                  <!-- ... -->
                  <!-- Compiler font manager classes, in policy resolution order-->
                  <managers>
                      <manager-class>flash.fonts.JREFontManager</manager-class>
                      <manager-class>flash.fonts.BatikFontManager</manager-class>
                      <manager-class>flash.fonts.AFEFontManager</manager-class>
                      <manager-class>flash.fonts.CFFFontManager</manager-class>
                  </managers>
                    <!-- ... -->
                </fonts>
            </compiler>
        </flex-config>
    ...and another from flash-unicode-table.xml:
    <language-range>
        <lang>Thai</lang>
        <range>U+0E01-0E5B</range>
    </language-range>
    My flex application originally had the following defined in its stylesheet:
        Application {
            fontSize: 12px;
            fontFamily: Arial;
            font-sharpness:0;
            font-anti-alias-type:advanced;
    Thai characters render correctly in mx components such as TextField so far.  However, FTE components such as TextLine show those crappy-looking boxes as a substitution.  My initial guess was that somehow one of the compiler font managers declared in flex-config.xml was not finding the right system font to fallback to for Thai characters.  So, I ensured the system font was installed by going to System Preferences > Language and Text > Edit List.  Then I changed fontFamily to Arial, Ayuthaya.  Still was seeing the boxes of evil.
    Next I figured that perhaps the Arial font might be assigning a box for each unicode value corresponding to a Thai character.  So it was effectively overriding the Ayuthaya system font.  So I changed fontFamily once more to just Ayuthaya and this worked with one issue - Ayuthaya looks inherently different from Arial for non-thai characters.
    Here's my question - is there a less invasive way to support Thai in FTE components such that the appearance of the text is closer to the Arial font?  I would rather not embed a font because I'm constrained on SWF size.
    Oh and I'm using flash player 10.3 right now.

    OK, I asked the FTE team and got this reply: "Lucida Grande is CTS's fallback font for Thai.  This font on OS 10.7 and 10.6 are not supporting Thai anymore.  The version on 10.5 was supporting it." This means that it's our bug that we keep using Lucida Grande as fallback font even Apple dropped support Thai script with that font after 10.6. Unfortunately this bug was deferred from current development release (11.2) because of time constraint. If this support is critical for your business, can you open a bug in our public bugbase and ask as many vote as possible? In this way I may be able to convince internal team to fix this bug in next release.
    Thank you for your feedback!
    Hitomi

  • Unicode characters a real challenge??????

    Hello everybody
    I cannot believe it that no one has been able to help me with displaying unicode characters (Arabic letters in particular) I have posted 2 threads no one has answered. I hope that someone out there knows how to handle unicode characters.
    that includes reading and writing them to a file.
    Hope you can help.
    Rana

    Hello Rana,
    Please use this code as a sample. You have to use this code inside of your paint() method.
    String myString = "\u0635\u0634\u0633\u0632\u0631\u0630\u0629\u0628\u0627";
    g.setFont(Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_MEDIUM));
    g.drawString(myString, (this.getWidth() - (Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_MEDIUM).stringWidth(myString))), 0, Graphics.TOP|Graphics.LEFT);And you can find the full list of unicode table of Arabic letters at this document:
    http://www.unicode.org/charts/PDF/U0600.pdf
    If you have some troubleshooting, please come back again, we can find a solution.
    Regards,
    Ran

  • A portable interpretable object code expressed as Unicode characters

    A portable interpretable object code expressed as Unicode characters
    My idea of a portable interpretable object code suitable for encoding into Unicode is presently at a point somewhere on the line between abstract pure mathematics and practical, widely used information technology.
    There is more information in the following thread.
    http://forum.high-logic.com/viewtopic.php?f=10&t=2364
    There has also been a thread in the Unicode Public Email List.
    http://www.unicode.org/mail-arch/unicode-ml/y2009-m03/0168.html
    http://www.unicode.org/mail-arch/unicode-ml/y2009-m03/
    Encoding of the portable interpretable object code is currently into plane 15, which is one of the Unicode Private Use Areas. Maybe a portable interpretable object code will one-day be encoded into regular Unicode, perhaps in plane 12.
    I am thinking that if an MHP application written in Java were produced which interprets the portable interpretable object code, then a sandbox environment could be produced that would enable lots of people to program content for the MHP platform by writing a program in the portable interpretable object code and that program be interpreted by the MHP application.
    William Overington
    3 April 2009

    You are hitting ORA-600 internal error during the connection.
    You did not even go to the line
    System.out.println("*******after getting aconnection");
    according to stack trace.
    Which versions of Oracle RDBMS (9.0.1 or 9.0.2) and JDBC are you using?
    Are they in sync?
    I believe the current problem may not be about NLS.
    Do you have a working ascii testcase?

  • Oracle Discoverer Desktop Report output showing unicode characters

    Hi,
    Oracle Discoverer Desktop 4i version Report output showing the below unicode characters.
    kara¿ah L¿MAK HOLD¿NG A.¿
    We ran the same query in sql at that time the data showing correctly.
    Please let me know, is there any language settings/ NLS settings are need to set
    Thanks in Advance.

    Hi
    Let me give you some background. In the Windows registy, every Oracle Home has a setting called NLS_LANG. This is the variable that controls, among other things, the numeric characters and the language used. The variable is made up of 3 parts. These are:
    language_territory.characterset
    Notice how there is an underscore character between the first two variables and a period between the last two. This is very important and must not be changed.
    So, for example, most American settings look like this: AMERICAN_AMERICA.WE8MSWIN1252
    The second variable, the territory, controls the default date, monetary, and numeric formats and must correspond to the name of a country. So if I wanted to use the Greek settings for numeric formatting, editing the NLS_LANG for Discoverer Desktop to this setting will do the trick:
    AMERICAN_GREECE.WE8MSWIN1252
    Can you please check your settings? Here's a workflow:
    a) Open up your registry by running Regedit
    b) Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE
    c) Look for the Oracle Home corresponding to where Discoverer Desktop is installed. It's probably called KEY_BIToolsHome_1
    d) Clicking on the Oracle Home will display all of the variables
    e) Take a look at the variable called NLS_LANG - if it is correct Exit the registry
    f) If its not correct please right-click on it and from the pop-up select Modify
    f) Change the variable to the right setting
    g) Click the OK button to save your change
    h) Exit the registry
    Best wishes
    Michael

  • CRVS2010 Beta - Cannot export report to PDF with unicode characters

    My report has some unicode data (Chinese), it can be previewed properly in the windows form report viewer. However, if I export the report document to PDF file, the unicode characters in exported file are all displayed as a square.
    In the version of Crystal Report 2008 R2, it can export the Chinese characters to PDF when I select a Chinese font in report. But VS2010 beta cannot export the Chinese characters even a Chinese font is selected.

    Barry, what is the specific font you are using?
    The below is a reformatted response from Program Management:
    Using non-Chinese font with Unicode characters (Chinese) the issue is reproducible when using Arial font in Unicode characters field. After changing the Unicode character to Simsun (A Chinese font named 宋体 in report), the problem is solved in Cortez and CR both.
    Ludek

  • 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 11.1.0.7.0. 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 11.1.0.7 (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.
    commit;
    2. Create QueryXMLType.java 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 (rs.next())
                   XMLType xml = XMLType.createXML(orset.getOPAQUE(1));
                   System.out.println(xml.getStringVal());
              rs.close();
              stmt.close();
    3. Compile QueryXMLType.java and execute QueryXMLType.class as follows:
    export PATH=$ORACLE_HOME/jdk/bin:$PATH
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib
    export CLASSPATH=.:$ORACLE_HOME/jdbc/lib/ojdbc5.jar:$ORACLE_HOME/jlib/orai18n.jar:$ORACLE_HOME/rdbms/jlib/xdb.jar:$ORACLE_HOME/lib/xmlparserv2.jar
    javac QueryXMLType.java
    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
    http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28369/xdb11jav.htm#i1033914
    and
    - Example 18-23 Using XQuery with JDBC
    http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28369/xdb_xquery.htm#CBAEEJDE

  • Insert Unicode Characters Into Oracle 8.1.5

    Hello,
    First off, here are the specs:
    Oracle 8.1.5
    JDK 1.2.1
    Oracle8i 8.1.6.2.0 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 8.1.6.2.0 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,
    Christian
    null

    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 http://download-uk.oracle.com/docs/cd/F49540_01/DOC/index.htm]The documentation

  • 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.

  • Is there a list of Unicode characters that can be used in Acrobat bookmarks?

    I can add Greek characters to Acrobat bookmarks using hexadecimal strings. For example, to print a lower case gamma symbol I use <FEFF03B3>. FEFF is the required Unicode flag and 03B3 is the Unicode code for gamma. This works fine. However, there are no Unicode entries for greek characters in the PDF 32000-1:2008 PDF Specification manual. Table D.2 - PDFDocEncoding Character Set on page 656 lists Unicode characters and these also work when added to bookmarks but no Greek codes are in this table. Since I can sucessfully use Greek Unicode characters in the range of 0x0391 - 0x03CE and these characters are not listed in the PDF manual I am assuming there are additional Unicode character that will work in bookmarks. Therefore, I am looking for a complete list of Unicode characters that can be used in Acrobat's bookmarks. Does such a list exist?

    Thank you for the response.
    I'm sorry to hear there is no list available. I'm building the Acrobat bookmarks automatically. The input data contains entity codings (for example, a lower case Greek gamma is coded as &#x03B3;) and I was hoping to be able to just pass these through with an automatic conversion to a hexadecimal string (for example <FEFF03B3>). If I had a list of valid Unicode characters, that will display in an Acrobat bookmark, I could validate each entity before the conversion and catch the ones that won't display correctly. I know these types of characters are out there because I have already come across them. For example, a superscript 5 (0x2075) displays fine in MSWord but shows as a white box in a bookmark. Now I'll need to proof the output PDFs and look for white boxes in the bookmarks so that I can build my list of unicode characters that do not work in Acrobat bookmarks.
    Again, thanks for your help.

  • Special Unicode characters in RSS XML

    Hi,
    I'm using an adapted version of Husnu Sensoy's solution (http://husnusensoy.wordpress.com/2007/11/17/o-rss-11010-on-sourceforgenet/ - thanks, Husnu) to consume RSS feeds in an Apex app.
    It works a treat, except in cases where the source feeds contain special unicode characters such as [right double quotation mark  - 0x92  0x2019] (thankyou, http://www.nytimes.com/services/xml/rss/nyt/GlobalBusiness.xml)
    These cases fail with
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00217: invalid character 8217 (U+2019) Error at line 19
    Any ideas on how to translate these characters, or replace them with something innocuous (UNISTR?), so that the XML transformation succeeds?
    Many thanks,
    jd
    The relevant code snippet is:
    procedure get_rss
    (  p_address                 in httpuritype
    ,  p_rss                    out t_rss
    is
       function oracle_transformation
          return       xmltype is
          l_result     xmltype;
       begin
          select xslt
          into   l_result
          from   rsstransform
          where  rsstransform = 0;
          return l_result;
       exception
       when no_data_found then
          raise_application_error(-20000, 'Transformation XML not found');
       when others then
          l_sqlerrm := sqlerrm;
          insert into errorlog...
       end oracle_transformation;
    begin
       xmltype.transform(p_address.getXML()
                        ,oracle_transformation
                        ).toobject(p_rss);
    exception
    when others then
      l_sqlerrm := sqlerrm;
      insert into errorlog....
    end get_rss;My environment:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE 11.2.0.1.0 Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    PARAMETER VALUE
    NLS_LANGUAGE AMERICAN
    NLS_CHARACTERSET WE8ISO8859P1
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_COMP BINARY
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CONV_EXCP FALSE

    environment
    Oracle 10g R2 x86 10.2.0.4 on RHEL4U8 x86.
    db NLS_CHARACTERSET WE8ISO8859P1
    After following the following note:
    Changing US7ASCII or WE8ISO8859P1 to WE8MSWIN1252 [ID 555823.1]
    the nls_charset was changed:
    Database character set WE8ISO8859P1
    FROMCHAR WE8ISO8859P1
    TOCHAR WE8MSWIN1252
    And the error:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00217: invalid character 8217 (U+2019)
    was no longer generated.
    A Unicode database charset was not required in this case.
    hth.
    Paul

  • 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 SpRetVal;
    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;
    } DBPROCESS;
    BOOL CDynamicPickList::GetResultSet(DBPROCESS *pDBProc, bstrt& pQuery, short pNumOdbcBindParams, COdbcBindParameter pOdbcBindParams[], CQueryResultSet& pQueryResultSet)
         int               lRetVal,
                        lNumRows;
         bstrt               lResultSet;
         wchar_t               lColName[[256]];     
         SQLUINTEGER          lColSize;
         SQLSMALLINT          lColNameLen,
                        lColDataType,
                        lColNullable,
                        lColDecDigits,                         
                        lNumResultCols;
         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,
    l_newcmd_length;
    p_sql_commandMBCS = (char *)calloc(sizeof(char) * MAX_CMD_BUFF,1);
    l_ret_val = WideCharToMultiByte(
                        CP_UTF8,
                        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 )
    l_org_length++;
    if( (l_org_length + l_newcmd_length) >= MAX_CMD_BUFF )
    if( l_org_length == 0 )
    OdbcReuseStmtHandle( p_ptr_dbproc );
    else
    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)
         free(p_sql_commandMBCS);
    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" ,
                                       "to_number(","convert(int,",
                                       /*"to_char(","convert(char,",*/
                                       /*"'yyyymmdd'","112",
                                       "'hh24miss'","108",*/
                                       "sysdate",     "getdate()",
                                       "format_date", "dbo.format_date",
                                       "format_amount", "dbo.format_amount",
                                       "to_char","dbo.to_char",
                                       "to_date", "dbo.to_date",
                                       "unique","distinct",
                                       "\0","\0"};
    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)
         free(l_qry_lwr);
    return( SUCCEED );
    case SQL_NEED_DATA :
    case SQL_ERROR :
    case SQL_SUCCESS_WITH_INFO :
    case SQL_STILL_EXECUTING :
    case SQL_INVALID_HANDLE :
    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,
    Pratik
    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
    Thanks,
    Pratik...
    Edited by: prats on Mar 3, 2009 2:41 PM

  • [SOLVED] Conky Not Displaying Unicode Characters Correctly

    I have some music that requires unicode characters in order to be displayed properly. The artist name is Röyksopp, but it is displayed like this:
    http://i.imgur.com/rRBDxZn.png
    Does anyone know how to either make it display correctly (Röyksopp), or at least remove the umlauts to make it almost correct(Royksopp)? I've set the locale, so it displays correctly in both i3bar and urxvt, but it had no effect on conky.
    EDIT: Here is my conkyrc.
    Last edited by ProfessorProcrastinator (2014-05-14 22:50:16)

    x33a wrote:Try a different font.
    I know that this font works because I tried it in urxvt and it displayed correctly.
    Also, I tried "override_utf8_locale yes" and it still was incorrect.

Maybe you are looking for

  • User can't open presentation saved as a PDF file

    I sent a presentation saved as a PDF file and the user could not open it.  The error message received was that his computer needed Adobe Flash Player 16.0.  Despite installing it, he still gets the same error message.

  • I've got a monitor that freezes while the canvas plays.  Suggestions?

    No cracks please about editing indoors... Not sure what's causing this. Have read through earlier posts. Still nothing, so here goes... I'm running FCP 5.0.4 on the G5, now at 10.4.4. and just recently I've started to have my external monitor freeze

  • How do I modify the file size

    I recently e-mailed a 1-page pdf document, converted from excel, that was 5.5 mb, whereas the original excel file was 50 kb. How does this happen, and how to correct this issue?

  • When will WLS 8.1 SP2 be GA ?

    Hi BEA, When will SP2 for WLS 8.1 be GA ? I see some fixes i need on the release notes but SP2 is not available for download. Thanks Yshemi

  • Plsql how to determine what the instance of an object is

    In my procedure I want to know if I have been passed the supertype of a sub type ie : create type super_type as object (id number(10) ) create type sub_a under super_type (a varchar2(10)) create procedure p_x(p_obj super_type) is begin -- something l