Byte/character,NVARCHAR2,UTF8

Database character set
=National charater set=UTF8
NLS_LANG=American_America.UTF8
OS=Win2k Pro ORACLE=8.1.6
I get a table:
desc test
Name type
a NVARCHAR2(2)
we wanna the 'a' column hold only two letters
regardless english,Traditional/Simplified chinese,it means we wanna:
INSERT INTO test | INSERT INTO test
VALUES | VALUES
(N'ha'); | (N'LF3/');
but I failed to insert two chinese letter into it,actually,only one can be hold,or error--"insert value too long.."--pop up.
can I do it?
the NVARCHAR2(2) means oracle would allocate
2 byte or 2 character for the 'a' column?
Thank u all.
Tale

But nls_lang2:
I did success in inserting one chinese letter into a column defined as NVARCHAR2(2).
it is impossible if one chinese letter occupy 3 bytes while NVARCHAR2(2)get
2 bytes allocated in UTF8 DB as u stated.
The db cannot allocate 2 charater becos I
cannot insert 2 chinese letters into it.
--example:
Database character set
=National charater set=UTF8
client NLS_LANG=American_America.UTF8
OS=Win2k Pro ORACLE=8.1.6
I altered the table:
desc test
Name type
a NVARCHAR2(2)
b varchar2(3)
c varchar2(4)
INSERT INTO test(a)
VALUES
(N'LF'); ---> it's successful.
when it come to varchar2,I altered the table as the upper:
after experiment,I can insert two chinese letters into the c column;
I can insert 4 english letters into c column;
I cannot insert 2 chinese letters into b column;
I can insert 3 english letters into b column;
so it seemed that chinese letter occupy 2 byte in the workaround,not 3,as u said.Infact,according to our applicaiton system,if we define column "d" as xyz(2) datatype
then it should only hold only two letters--regardless of english/chinese,which means
"me" and "SQRj" should be huged even.
what's going on?
Thank you
ciao
Tale
null

Similar Messages

  • Character sets - UTF8 or Chinese

    Hi,
    I am looking into enhancing the application I have built in Oracle to save/display data in Chinese & English. I have looking into how to change the character set of a database to accept different languages i.e. different characters.
    From what I understand I can create a database to use a Chinese character set (apparently English ascii characters are also a part of any Chinese character set) or I can set the database to use a unicode multi-byte character set (UTF8) - which seems to be okay for all languages.
    Has anyone had any experience of a) changing an existing standard 7 byte ascii database into database which can handle Chinese and/or b) the difference/ implications between using a Chinese and unicode character sets.
    I am using Oracle RDBMS 8.1.7 on SuSE Linux 7.2
    Thanks in advance.
    Dan

    If the data is segmented so that character set 1 data is in a table and character set 2 data is in another table then you may have a chance to salvage the data with help from support. The idea would be to first export and import only your CL8MSWIN1251 data to UTF8. Be careful that your NLS_LANG is set to CL8MSWIN1251 for export so that no conversion takes place. Confirm the import is successful and remove CL8MSWIN1251 data from database. Oracle support can now help you override the character set via ALTER database to say MSWIN1252. Now selectively export/import this data, again make sure NLS_LANG is set to MSWIN1252 for export so that no conversion takes place. Confirm the import is successful and remove MSWIN1252 data from database. And then do the same steps for 1250 data.

  • Multi-byte character

    If DATABASE CHARACTER SET is UTF-8 than
    Than can i use VARCHAR2 to store multi-byte character or i still have to use
    nvarchar2
    also vachar2(1),nvarchar2(1) can store how much (max) bytes in case of UTF-8 CHARACTER SET

    If you create VARCHAR2(1) then you possibly can not store anything as your first character might be multibyte.
    My recommendation would be to consider defining by character rather than by byte.
    CREATE TABLE tbyte (
    testcol VARCHAR2(20));
    CREATE TABLE tchar (
    testcol VARCHAR2(20 CHAR));The second will always hold 20 characters without regard to the byte count.
    Demos here:
    http://www.morganslibrary.org/library.html

  • Where is the Multi-Byte Character.

    Hello All
    While reading data from DB, our middileware interface gave following error.
    java.sql.SQLException: Fail to convert between UTF8 and UCS2: failUTF8Conv
    I understand that this failure is because of a multi-byte character, where 10g driver will fix this bug.
    I suggested the integration admin team to replace current 9i driver with 10g one and they are on it.
    In addition to this, I wanted to suggest to the data input team on where exactly is the failure occured.
    I have asked them and got the download of the dat file and my intention was to findout where exactly is
    that multi-byte character located which caused this failure.
    I wrote the following code to check this.
    import java.io.*;
    public class X
    public static void main(String ar[])
    int linenumber=1,columnnumber=1;
    long totalcharacters=0;
    try
    File file = new File("inputfile.dat");
    FileInputStream fin = new FileInputStream(file);
    byte fileContent[] = new byte[(int)file.length()];
    fin.read(fileContent);
    for(int i=0;i<fileContent.length;i++)
       columnnumber++;totalcharacters++;
       if(fileContent<0 && fileContent[i]!=10 && fileContent[i]!=13 && fileContent[i]>300) // if invalid
    {System.out.println("failure at position: "+i);break;}
    if(fileContent[i]==10 || fileContent[i]==13) // if new line
    {linenumber++;columnnumber=1;}
    fin.close();
    System.out.println("Finished successfully, total lines : "+linenumber+" total file size : "+totalcharacters);
    catch (Exception e)
    e.printStackTrace();
    System.out.println("Exception at Line: "+linenumber+" columnnumber: " +columnnumber);
    }But this shows that the file is good and no issue with this.
    Where as the middleware interface fails with above exception while reading exactly the same input file.
    Anywhere I am doing wrong to locate that multi-byte character ?
    Greatly appreciate any help everyone !
    Thanks.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    My challenge is to spot the multi-byte character hidden in this big dat file.
    This is because the data entry team asked me to spot out the record and column that has issue out of
    lakhs of records they sent inside this file.
    Lets have the validation code like this...
       if( (fileContent<0 && fileContent[i]!=10 && fileContent[i]!=13) || fileContent[i]>300) // if invalid
    {System.out.println("failure at position: "+i);break;}lessthan 0 - I saw some -ve values when I was testing with other files.
    greaterthan 300 - was a try to find out if any characters exceeds actual chars. range.
    if 10 and 13 are for line-feed.
    with this, I randomly placed chinese, korean characters and program found them.
    any alternative (better code ofcourse) way to catch this black sheep ?
    Edited by: Sanath_K on Oct 23, 2009 8:06 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Unable to generate single byte character when used TO_SINGLE_BYTE

    Hi All,
    Can anyone help me in getting the output for the below single byte query. When tried it says INVALID NUMBER.
    Step 1 :-
    select RAWTOHEX('2Z') from DUAL; -- 325A
    Step 2:-
    SELECT TO_SINGLE_BYTE(CHR('325A')) FROM DUAL;
    The above query when executed it says "ORA-01722: invalid number".
    I tried using VARCHAR2 instead of CHR it throuws the below exception,
    "ORA-00936: missing expression".
    But the same query if no characters are passed is working fine.
    SELECT TO_SINGLE_BYTE(CHR('3251')) FROM DUAL;
    Thanks,
    Ravi

    TO_SINGLE_BYTE is used to convert multi-byte characters to single-byte characters. '325A' is not a multi-byte character so can't be converted.
    Use HEXTORAW to convert the hex value back to a raw value.

  • Crystal XI R2 exporting issues with double-byte character sets

    NOTE: I have also posted this in the Business Objects General section with no resolution, so I figured I would try this forum as well.
    We are using Crystal Reports XI Release 2 (version 11.5.0.313).
    We have an application that can be run using multiple cultures/languages, chosen at login time. We have discovered an issue when exporting a Crystal report from our application while using a double-byte character set (Korean, Japanese).
    The original text when viewed through our application in the Crystal preview window looks correct:
    性能 著概要
    When exported to Microsoft Word, it also looks correct. However, when we export to PDF or even RPT, the characters are not being converted. The double-byte characters are rendered as boxes instead. It seems that the PDF and RPT exports are somehow not making use of the linked fonts Windows provides for double-byte character sets. This same behavior is exhibited when exporting a PDF from the Crystal report designer environment. We are using Tahoma, a TrueType font, in our report.
    I did discover some new behavior that may or may not have any bearing on this issue. When a text field containing double-byte characters is just sitting on the report in the report designer, the box characters are displayed where the Korean characters should be. However, when I double click on the text field to edit the text, the Korean characters suddenly appear, replacing the boxes. And when I exit edit mode of the text field, the boxes are back. And they remain this way when exported, whether from inside the design environment or outside it.
    Has anyone seen this behavior? Is SAP/Business Objects/Crystal aware of this? Is there a fix available? Any insights would be welcomed.
    Thanks,
    Jeff

    Hi Jef
    I searched on the forums and got the following information:
    1) If font linking is enabled on your device, you can examine the registry by enumerating the subkeys of the registry key at HKEY_LOCAL_MACHINEu2013\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink to determine the mappings of linked fonts to base fonts. You can add links by using Regedit to create additional subkeys. Once you have located the registry key that has just been mentioned, from the Edit menu, Highlight the font face name of the font you want to link to and then from the Edit menu, click Modify. On a new line in the dialog field "Value data" of the Edit Multi-String dialog box, enter "path and file to link to," "face name of the font to link".u201D
    2) "Fonts in general, especially TrueType and OpenType, are u201CUnicodeu201D.
    Since you are using a 'true type' font, it may be an Unicode type already.However,if Bud's suggestion works then nothing better than that.
    Also, could you please check the output from crystal designer with different version of pdf than the current one?
    Meanwhile, I will look out for any additional/suitable information on this issue.

  • How to deal with the two bytes character in 'IF_IXML_NODE'

    we can create dom with Xstring
    ostream = streamfactory->create_ostream_xstring( string = lv_xstring )
    but if one value of the node is two bytes character.
    if_ixml_node->get_value( ), only retrun string value, so the result is
    wrong, it will display "##", how to fix it?
    Thanks a lot for your help.

    we can create dom with Xstring
    ostream = streamfactory->create_ostream_xstring( string = lv_xstring )
    but if one value of the node is two bytes character.
    if_ixml_node->get_value( ), only retrun string value, so the result is
    wrong, it will display "##", how to fix it?
    Thanks a lot for your help.

  • Report in PDF format can not support double byte character ?

    Hi :
    I am developing the simplified chinese application , when i generate the report in PDF format , i found all double byte character did not display correctly . i am using dev6i+patch5 , why ?
    it is a bug of form or not ???????
    HELP !!!

    try this ,Install acrobat4.0 or above and make sure you got acrobat distiller which will add a acrobat distiller printer in you windows. print report direct to that printer (don't change desformat) and you should got your PDF file with correct font setting.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by xie min ([email protected]):
    Hi :
    I am developing the simplified chinese application , when i generate the report in PDF format , i found all double byte character did not display correctly . i am using dev6i+patch5 , why ?
    it is a bug of form or not ???????
    HELP !!!<HR></BLOCKQUOTE>
    null

  • Multi-byte character encoding issue in HTTP adapter

    Hi Guys,
    I am facing problem in the multi-byte character conversion.
    Problem:
    I am posting data from SAP CRM to third party system using XI as middle ware. I am using HTTP adapter to communicate XI to third party system.
    I have given XML code as UT-8 in the XI payload manipulation block.
    I am trying to post Chines characters from SAP CRM to third party system. junk characters are going to third party system. my assumption is it is double encoding.
    Can you please guide me how to proceed further.
    Please let me know if you need more info.
    Regards,
    Srini

    Srinivas,
    Can you go through the url:
    UTF-8 encoding problem in HTTP adapter
    ---Satish

  • JSF and Double Byte Character

    Hi,
    I wanted to know how to handle <h:outputText> with chinese character or double byte character.
    See sample code below :
    <%@ page language="java" contentType="text/html; charset=UTF-8"      pageEncoding="UTF-8"%>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <h:form styleClass="form" id="form1">
    <% request.setCharacterEncoding("UTF-8"); %>
    <h:inputText styleClass="inputText" id="text1"></h:inputText>
    <hx:commandExButton type="submit" value="Submit" styleClass="commandExButton" id="button1"      action="#{pc_SubmitTest.doButton1Action}"></hx:commandExButton>
    <h:outputText styleClass="outputText" id="text2"></h:outputText>
    </h:form>
    When you input with double byte character and submit,
    the output screen value did not render properly .
    I tried this similiar code at JSP, it work fine.
    Anybody know how to solve this problem ?
    Anything need to do at pagecode level ?
    Thank you.
    Reinardy

    Problem was due to the fact that I was trying to generate the excel file in char stream instead of byte stream

  • To read Double Byte Character

    Hello All,
    What is meant by Double Byte Character.
    I want to read the this Double Byte Character.Is there any function module or class to read this or any other way to get the double byte character.
    This is very urgent please i will reward points.
    Thanks,
    Karan

    Hello Indrakaran,
    For to determine Field Properties in Unicode please take a look at the New Unicode Class CL_ABAP_CHAR_UTILITIES.
    CHARSIZE attributes:
    The CHARSIZE attribute declares the length of a C(1) field in bytes - that is, one byte in NUS, and either two or four in US, UTF-8 or UTF-16 respectively.
    Hope it helps,
    Heinz

  • How to set Multi Byte Character Set ( MBCS ) to Particular String In MFC VC++

    I Use Unicode Character Set in my MFC Application ( VC++) .
    now i get the output   ठ桔湡潹⁵潦⁲獵 (like this )character and i want to convert this character in english language (means MBCS),
    But i need Unicode to My Applicatiion. when i change the Multi-Byte Character set It give Correct output in English but other Objects ( TreeCtrl Selection ) will perform wrongly .  so i need to convert the particular String to MBCS
    how can i do that ? In MFC

    I assume your string read from your hardware device is an plains "C" string (ANSI string). This type of string has one byte per character. Unicode has two bytes per character.
    From the situation you explained I'd convert the string returned by the hardware to an Unicode string using i.e. MultibyteTowideChar with CP_ACP. You may also use mbstowcs or some similar functions to convert your string to an Unicode string.
    Best regards
    Bordon
    Note: Posted code pieces may not have a good programming style and may not perfect. It is also possible that they do not work in all situations. Code pieces are only indended to explain something particualar.

  • Jolt and wtc support double byte character??

    hi all,
    the wtc couldn't support double byte character while passing data from weblogic
    7 to tuxedo 8. so, can jolt do it?? say passing double type character.
    your quick response would be appreciable!
    sang

    try this ,Install acrobat4.0 or above and make sure you got acrobat distiller which will add a acrobat distiller printer in you windows. print report direct to that printer (don't change desformat) and you should got your PDF file with correct font setting.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by xie min ([email protected]):
    Hi :
    I am developing the simplified chinese application , when i generate the report in PDF format , i found all double byte character did not display correctly . i am using dev6i+patch5 , why ?
    it is a bug of form or not ???????
    HELP !!!<HR></BLOCKQUOTE>
    null

  • NATIONAL CHARACTER SET UTF8

    Hi,
    on 10g, on Win 2003, how to verify if database is NATIONAL CHARACTER SET UTF8 ?
    Thank you.

    SELECT *
      FROM v$nls_parameterswill show you all the NLS parameters. You're presumably looking for the row where parameter = 'NLS_NCHAR_CHARACTERSET' though there may be a few more parameters that you're interested in.
    Justin

  • Why can't call java method when I input  4 bytes character to the TextInput

    I am using Flex4 + Cairngorm2 + BlazeDS3.2 + Java + Spring
    Can't call java program when I input  4 bytes character in Flex.
    Example:
    Please help!

    Basic troubleshooting steps clearly outlined in the User Guide are restart, reset, restore from backup, restore as new device.
    Have you tried ALL the troubleshooting steps?  If you have and you're still having problems, then you'll need to bring your phone into Apple for evaluation and possible exchange.

Maybe you are looking for

  • Two ipod touches one apple id

    Hi My two kids both have an ipod touch, and I have the apple id on my computer.   However when my daughter sends and receives messages from her ipod my son can read them and join in conversation (which is annoying my daughter)  how can I stop this ha

  • Looking for a program that can handel import and export of palm doc files

    I am looking for a program that can handel the import and export of palm doc Files that can convert them to to either txt or RTF files for Vista 32, running Palm Desktop 7.1. Could anyone give me a few suggestions of any plug-ins that would be good m

  • Too Many Attempts?

    I've just moved onto a new wireless router/network at home, and I can no longer connect to iChat wirelessly. All other internet applications work, but when I open iChat, it logs on, immediately logs off, and does it again and again until I get an err

  • Help - french accents words not displaying/storing correctly in database

    Hello - I have 2 databases running in 2 different character sets. I am able to insert the following french accents in both databases and stored correctly also in db and displayed correctly in sql plus - à À Ä ä Â â é É È è Ë ë Ê ê î Î ï Ï ç Ç Û û ô æ

  • Windows 8 says itunes app will not run on my new pc. any ideas?

    silly computer. is not happy about me even downloading itunes let alone trying to run it. Its not my firewall thats this issue. any ideas how to get it sorted as i want to transfer my library onto new computer?