How to store UTF-8 characters in an iso-8859-1 encoded oracle database?

How can we store UTF-8 characters in an iso-8859-1 encoded oracle database? We can NOT change the database encoding but need to store e.g. Polish or Russian characters besides other European languages.
Is there any stable sollution with good performance?
We use Oracle 8.1.6 with iso-8859-1 encoding, Bea WebLogic 7.0, JDK 1.3.1 and the following thin driver: "Oracle JDBC Driver version - 9.0.2.0.0".

There are a couple of unsupported options, but I wouldn't consider using them on a production database running other critical applications. I would also strongly discourage their use unless you understand in detail how Oracle National Language Support (NLS) works, otherwise you could end up with corrupt data or worse.
In a sense, you've been asked to do the impossible. The existing databas echaracter sets do not support encoding the data you've been asked to store.
Can you create a new database with an appropriate database character set and deploy your application there? That's probably the easiest solution.
If that isn't an option, and you really need to store data in this database, you could use one of the binary data types (RAW and BLOB), but that would mean that it would be exceptionally difficult for applications other than yours to extract the data. You would have to ensure that the data was always encoded in the same character set, otherwise you wouldn't be able to properly decode it later. This would also add a lot of complexity to your application, since you couldn't send or recieve string data from the database.
Unfortunately, I suspect you will have to choose from a list of bad options.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC

Similar Messages

  • How to validate UTF-8 characters using Regex?

    Hi All,
    In one of my applications, i need to include UTF-8 character set for validation of a certain string, which I am validating using a Regex.
    However, I do not know how to include UTF-8 characters in a Regex, or if at all, we can specify the UTF-8 charaters ina regex.
    Please Help!! Its Urgent!!!
    Thanks in Advance,
    Rajat Aggarwal

    Ok, Let me re-state my problem again, and exactly what i am looking for:
    I have an XML file with the following header: <?xml version="1.0" encoding="UTF-8"?>
    This XML file contains a tag, whose text is to be validate for a syntax : Operand operator Operand.
    Now, the operand on the right hand side of the operator could be a variable, or a string literal, which may contain some permissible special characters (as said above), and may or may not contain UTF-8 characters as well.
    I am using the xerces SAXParser to parse the XML document, and am retrieving the text of the elemnt tag with the method <code>element.getChildText("<tagName>")<//code>
    According to the org.jdom.Element API Docs,
    the getChildText() method is defined as follows:
    h3. getChildText{noformat}public java.lang.String getChildText(java.lang.String name){noformat}<dl><dd>Returns the textual content of the named child element, or null if there's no such child. This method is a convenience because calling <code>getChild().getText()</code> can throw a NullPointerException. <br<dd><dl><dt>Parameters: </dt><dd><code>name</code> - the name of the child </dd><dt>Returns: </dt><dd>text content for the named child, or null if no such child
    </dd></dl></dd></dl>
    Now, I am not sure if the String that I am reading is in UTF-8 Format. Is there any special way of reading a string in that format, or for that matter, convert a string to UTF-8 encoding?
    h3.

  • WSDL Generating in ISO-8859-1 encoding want in UTF - 8

    Hi XI Geeks,
           When I am using "Define Web Service" tool in Integration Directory, the WSDL file is being created with encoding <b>ISO-8859-1</b>, <i><b>but we want in "UTF-8"</b></i>.
            Is there any setting we need to change in WAS which will change this default.
    Any ideas are welcome and thanks in advance.
    Regards
    Sujan

    Hi Vishnu,
             We already did that for the time being. But the client wants it be consistent.
             In another client engagement the WSDL is created in  "UTF-8" format we double checked twice.
             We are running on SP12.
    If any of the SP12 guys can generated a WSDL and let us know that it is created in "ISO-8859-1" encoding.
    Regards
    Sujan

  • How to get UTF-8 Characters from HTML to Java?

    Hi everyone, I'm trying to set up an application that will allow display and entry of international data from HTML forms via servlets. The problem is that I can't get the data back into a java string to apply to the DBMS.
    I have tried using UTF-8 and specific character sets such as ISO-8859-5 (Russian). I have specified these character sets/encodings as follows:
    HTML: meta content-type header charset=xxx and <form accept-charset=xxx
    Servlet Response: setLocale(appropriate locale) and setContentType("text/html; charset=xxx") prior to calling response.getWriter()
    Servlet Request: setCharacterEncoding("xxx") (e.g. servlet 2.3)
    When I use request.getParameter(xxx) I get normal characters (a, b, c) and nothing for international characters or sometimes question marks.
    I have also tried various combinations of:
    new String(request.getParameter("xxx").getBytes("xxx"),"xxx")
    Could someone please point me in the right direction?
    TIA

    Thanks for all of your suggestions. It still refuses to work.
    I entered the following: ���^�E on the HTML form using the Chinese(PRC)keyboard on my Win2K box.
    I checked and verified the correct encoding in the servlet request (GB2312 for chinese characters)
    request.getParameter(xxx) yields ???
    new String(request.getParameter(xxx).getBytes("GB2312")) yields three boxes (values 20309, 27946 and 23380)
    new String(request.getParameter(xxx).getBytes("GB2312"), "UTF-8") yields nothing
    Any ideas?

  • UTF-8 encoding vs ISO 8859-1 encoding

    The iTunes tech specs call for UTF-8 encoding of the XML feed file; a friend of mine uses feed generator software through his blog that uses ISO 8859 encoding. Is there a way to convert the latter to UTF-8 so that iTunes tags may be successfully added?
    When I tried editing his XML file, I got error messages when I submitted the file to RSS feed validator sites (such as http://feedvalidator.org/. Any help or knowledge is appreciated because I am not the least bit expert in this coding arena.

    You don't need to convert iso 8859-1 (us-ascii) to utf-8 unless you have nonstandard characters. Basically, ascii is a subset of utf-8 and for English it will serve you just fine. You can have iTunes tags in the xml file even if the file itself is encoded in iso 8859-1.
    The error you see at feedvalidator.org is most likely a warning.
    Hope this helps!
    - Andy Kim
    Potion Factory
    http://www.potionfactory.com

  • Convert from ISO 8859-1 encoding to UTF-8

    Hi
    My Os name is 'SunOS ut51109 5.10 Generic_144500-19 sun4v sparc SUNW,T5440'.
    I want to change the encoding of the existing .bcp file from ISO 8859-1 to UTF-8 with out using any temp files as these .bcp file will be pointed by an external table.
    here is the command I issued in the script(ksh file)
    iconv -f ISO8859-1 -t UTF-8 file1.bcp > file1.bcp
    After the script got executed file1 is empty(showing 0 bytes).
    Please correct me or let me know the syntax to be followed to write the data into the same file in UTF-8 format.
    Thanks
    kartheek

    You cannot do conversion from ISO 8859-1 to UTF-8 in-place because the UTF-8 version will generally be longer (unless you convert a pure ASCII file, which does not need conversion in the first place). Therefore, you would have to overwrite what you have not read yet. Instead, convert to a new file with a temporary name, drop the original and rename the temporary back to original. This is not that complicated.
    If the problem is that you want to overwrite a file already open by the database, then rename the incoming file first and then convert copying to the target.
    -- Sergiusz

  • How to store the data captured from oscillosco​pe into the MS Access database table

    Hi All,
    In my application, I tried to save the data captured from SCOPE, but could store only 200 bytes. I've taken the Memo data type for the field in database. I want to store all data ( 4 channels) in one field & retrieve back and display on the XY Graph.
    Thanks in advance.
    Regards,
    Shrini

    kramish wrote:
    Im pretty sure that Access does support JDBCNo it does not. It supports ODBC.
    just doing a quick Google came up with some pages:
    http://blog.taragana.com/index.php/archive/access-microsoft-access-database-from-java-using-jdbc-odbc-bridge-sample-code/
    http://www.javaworld.com/javaworld/javaqa/2000-09/03-qa-0922-access.html
    Both articles explains how to use the jdbc-odbc bridge. I think I've seen a pure jdbc driver for access but it wasn't from Microsoft and it wasn't free.
    Kaj

  • How to convert back from UTF8 to ISO-8859-1 encoding?

    hi,
    I have a bunch of XML files which were wrongly encoded, and we lost all our accent characters.
    ie: é become é
    so how can I recover my XML files using powershell?
    so I want to change all the UTF8 ecoded characters back to the original ISO accent character
    é -> é
    I try this:
    1")
    $utf8 = [System.text.Encoding]::UTF8
    $utfBytes = $utf8.GetBytes("é")
    $isoBytes = [System.text.Encoding]::Convert($utf8, $iso, $utfBytes)
    $iso.GetString($isoBytes)
    but doesnt works.
    so is there a way to do this in powershell?
    I have to scan hundreds of files...
    thanks.

    You can't.  UTF-8 strips all of the information from the characters so you cannot know which characters are which.  If you know which characters you need to fix (requires knowing the spelling of the words) you could possible develop an matrix of
    replacements. There is no simple one line method.
    ¯\_(ツ)_/¯

  • How to pass a date parameter from report builder query designer to oracle database

    i'm using report builder 3.0 connected to oracle database. i'm trying to pass a date parameter in the query with no success, i don't
    know the exact syntax. I've tried :
    SELECT * FROM igeneral.GCL_CLAIMS where CREATED_BY IN (:CREATED_BY) AND CLAIM_YEAR IN(:UW_YEAR) AND (LOSS_DATE) >To_Date('01/01/2014','mm/dd/yyyy')
    it worked perfectly.
    However if i try to put a date parameter "From" instead of 01/01/2014 it will not work, a Define Query Parameter popup window appear and error occurred after i fill
    the values (usually i shouldnt get this popup i should enter the value when i run the report)
    SELECT * FROM igeneral.GCL_CLAIMS where CREATED_BY IN (:CREATED_BY) AND CLAIM_YEAR IN(:UW_YEAR) AND (LOSS_DATE) >To_Date(:From,'mm/dd/yyyy')
    appreciate your assistance

    Hi Gorgo,
    According to your description, you have problem when in passing a parameter for running a Oracle Query. Right?
    Based on my knowledge, it use "&" as synax for parameter in Oracle, like we use "@" in SQL Server. In this scenario, maybe you can try '01/01/2014' when inputing in "From". We are not sure if there's any limitation for To_Date()
    function. For your self-testing, you can try the query in sqlplus/sql delveloper. Since your issue is related to Oracle query, we suggest you post this thread onto Oracle forum.
    Best Regards,
    Simon Hou

  • How to insert and retreive zip files in to blob column in oracle database?

    This is the code to retrieve               
    while (rs.next() ) {
                        Blob fileBlobContent = rs.getBlob(1);
                        String fileName = rs.getString(2);                    
                        String value = rs.getString(3);
                        long fileNum = new Long(value).longValue();
                        java.io.InputStream is =
                             ((oracle.sql.BLOB) fileBlobContent).getBinaryStream();
                        FileOutputStream fos =
                             new FileOutputStream("c:\\temp\\"+fileName);
                        int c = -1;
                        while ((c = is.read()) != -1) {
                             fos.write(c);
    This is the code to insert into the row aftre inserting empty blob
                   // step 3 - now put the contents of the file
                   int length = 0;
                   int buff_size = 1024;
                   //Writer out_clob = ((oracle.sql.CLOB)fileCobContent).getCharacterOutputStream();
                   OutputStream outstream = ((oracle.sql.BLOB) fileBlobContent).getBinaryOutputStream();
                   long chars_read = data.length();
                   byte[] buffer = new byte[buff_size];
                   while ((length+buff_size) < chars_read) {
                        outstream.write(buffer, length, buff_size);
                        length += buff_size;
                        //outstream.flush();
                   // write remaining data
                   int remaining = (int)(chars_read-length);
                   outstream.write(buffer, length, remaining);
                   // steps 4-5:
                   outstream.flush();
    Any help is greatly appreciated. Thanks!

    String localStrFile = importFormFileArg.getFileName();
    try
    localStrFileExt = localStrFile                    .substring(localStrFile.indexOf(".") + 1);
         localInputStream = importFormFileArg.getInputStream();
         localBr = new BufferedReader(
         new InputStreamReader(                         localInputStream));
              /** Read line by line and count the tokens present */
         while ((localStrReadLine = localBr.readLine()) != null)
         localIntRecords++;
                        /* parse the file contents with the delimiter comma */
                        if ("xls".equalsIgnoreCase(localStrFileExt))
                             localIsMandatoryPresent = isMandatoryFieldsPresent(
                                  localStrReadLine, ',');*/
                             System.out.println(localStrReadLine+" first \n\n\n ");
                             localStk = new StringTokenizer(
                                  localStrReadLine, "\t");
                             StringTokenizer localStk1 = new StringTokenizer(
                                  localStrReadLine, ",");
    // here i am unable to getting the records pls any body helpme                                             }
    Edited by: mulamahi on Oct 26, 2007 12:32 AM

  • How to insert and retrieve zip files in to blob column in oracle database?

    Hi All,
    I have a requirement where i need to insert zip files to BLOB and retrieve them.
    Please suggest me any good example or redirect me to them.

    You already have a post on this subject here: read and write compressed data from blob in ADF
    Please do not post duplicate questions.

  • How to connect from SAP on DB2 for i5/OS to external oracle database

    Hello,
    I managed to retrieve data from an external DB2 for i5/OS database using ABAP Native SQL running on another i5/OS server.
    I also managed to retrieve data from an external oracle database using ABAP Native SQL running on another Windows/Oracle server.
    Now i want to use ABAP Native SQL running on an i5/OS and retrieve data from an external Oracle database?
    I suppose i need software to connect fron I5/OS to this oracle database like you need extra software when you want to connect to an i5/OS database if you are running SAP on Windows (read note 751451)
    Does anybody know?
    Thanks in advance
    Bertil Rebergen

    Hello Bertil,
    to access an Oracle database from within an SAP system you'll need SAP's database interface library specific for Oracle plus the Oracle database client library utilized by SAP's database interface library. Both need to be available for the operating system your application server runs on, i.e. IBM i5/OS in your scenario.
    Since the required Oracle database client software is not available for IBM i5/OS your SAP application servers on IBM i5/OS cannot access your Oracle database.
    To overcome this limitation you would need to add at least one additional SAP application server based on Windows or Linux/Power to your current SAP system utilizing IBM DB2 for i5/OS. Since the required software libraries are available for these two operating systems you will be able to solve your problem this way.
    Best Regards, Christian Hoelters, SAP AG.

  • How to set my character coding to 'Western ISO-8859-1' permanently?

    I am having a REALLY annoying problem here. I want to set my character encoding to 'Western ISO-8859-1' permanently. I am able to successfully change it for a while but a couple of minutes barely pass and it reverts back to 'Unicode', even if I am on the same page and idle. I need immediate help here, as I am not able to do an urgent task that requires my encoding to be set at 'Western'.

    Go to Tools -> Options, click on the tab Content. In the group "Fonts & Colours" click the button Advanced. In the windows that pops up, set the Default Character Encoding to Western (ISO-8859-1).

  • Codepage Conversionerror UTF-8 from System-Codepage to Codepage iso-8859-1

    Hello,
    we have on SAP PI 7.1 the problem that we can't process a IDOC to Plain HTTP.
    The channel throws "Codepage Conversionerror UTF-8 from System-Codepage to Codepage iso-8859-1".
    The IDOC is 25 MB. Does anybody have a idea how we can find out what is wrong with the IDOC?
    Thanks in advance.

    In java strings are always unicode i.e. utf16. Its the byte arrays that are encoded. So use the following codeString iso,utf,temp = "����� � �����";
    byte b8859[] = temp.getBytes("ISO-8859-1");
    byte butf8= temp.getBytes("utf8");
    try{
      iso = new String(b8859,"ISO-8859-1");
      utf = new String(butf8,"UTF-8");
      System.out.println("ISO-8859-1:"+iso);
      System.out.println("UTF-8:"+utf);
      System.out.println("UTF to ISO-8859-1:"+new String(utf.getBytes("iso8859_1"),"ISO-8859-1"));
    System.out.println(utf);
    System.out.println(iso);
    }catch(Exception e){ }Also keep in mind that DOS window doesnot support international characters so write it to a file

  • Reverting from UTF-8 to ISO-8859-1

    Hi,
    i have a database installed in UTF-8, it´s a new instalation and the guides i had didnt mention any restrictions on characterset for the teams that were migrating.
    Well the problem is some teams are moving some of their projects to the new server and can´t insert in a VARCHAR2 (3), for example the word "não".
    My question is: Can i change the whole database to ISO-8859-1 instead of UTF-8 in order to have words like "não" inserted correctly? If so, is it a simple alter database or a more complicated operation?
    Another question, is there any possibility of letting the database as is and make it work without expanding the fields value restriction?
    Alx

    You can't change a database character set from ISO-8859-1 to UTF8. You can only move from one character set to a strict superset, which doesn't apply here. The supported way to change the character set here would be to create a new database with the ISO-8859-1 character set, export the existing data, and import it into the new system. That assumes, of course, that all the existing characters have an ISO-8859-1 representation (characters like the Euro symbol or Microsoft's curly quotes do not).
    By default, a VARCHAR2(3) allocates 3 bytes of space for data. That gets complicated when you use a multi-byte character set like UTF-8 where a character like 'ã' requires 2 bytes of storage. You can define the columns as VARCHAR2(3 CHAR) to allocate 3 characters of storage regardless of the character set. You can also set the parameter NLS_LENGTH_SEMANTICS to CHAR to make the default when you create a table that character rather than byte length semantics are set. Personally, if I'm creating a UTF8 database, I'd want to set NLS_LENGTH_SEMANTICS to CHAR.
    Justin

Maybe you are looking for

  • How to change the view criteria at run time for af:query

    Hi, I've a usecase where I need to change the view criteria of the af:query at run time. Use case: ======= 1) Consider a check box (Show Emps Under Dept 10) in the query panel when user selects and clicks 'Search' button should show the employees und

  • I can't install suit cs6

    When i was install the Photoshop cs6 in F/: (external hard drive) i broke the device, and when i go to reinstall whatever siut cs6 software don'nt let me. tell me this: Exit Code: 7 Please see specific errors and warnings below for troubleshooting. F

  • How to change export video size settings?

    I just upgraded from iMovie to Final Cut Pro X. I am trying to export my 1080P content as a 720P file, something that was very easy on the basic iMovie setup. I noticed when I tried to export to Vimeo I was given options for file quality and video si

  • HTTP error for content repository

    Dear gurus, we defined a content repository to store images (Employee photos) in our HR instance (ECC 6). we set customizing for Sap Archive Link and "document type" (HRICOLFOTO). We followed suggestions of this link: [http://www.sd-solutions.com/doc

  • How to get the Max value of elements of type datetime

    Hi All , I wanted to get the latest timestamp value ( datatype as datetime) from node list. I have following xml. In this xml, i want to get the modifydate element which has latest timestamp through xquery/xpath, it should return me following result