• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Unicode on Oracle

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Unicode on Oracle

    Just a quick one on VARCHAR2 vs NVARCHAR2.

    My understanding was that on a UTF8 database international characters have to be stored in NVARCHAR2 (unicode).

    I just got told that VARCHAR2 can also store international characters.

    I tried this

    CREATE TABLE NATIONAL_CHARACTERS
    (
    NON_UNICODE VARCHAR2(50),
    ACTUAL_UNICODE NVARCHAR2(50)
    );

    INSERT INTO NATIONAL_CHARACTERS (NON_UNICODE, ACTUAL_UNICODE) VALUES ('le premier étage','le premier étage');

    SELECT * FROM NATIONAL_CHARACTERS;

    1 le premier étage le premier étage

    wtf? é is not in the ascii character set.

    Someone take me back to school.

    Edit : I tried this also INSERT INTO NATIONAL_CHARACTERS (NON_UNICODE, ACTUAL_UNICODE) VALUES ('汉字/漢字','汉字/漢字');

    SELECT * FROM NATIONAL_CHARACTERS;

    1 le premier étage le premier étage
    2 汉字/漢字 汉字/漢字

    Last edited by suityou01; 21 September 2012, 11:52.
    Knock first as I might be balancing my chakras.

    #2
    Hmm. We use Oracle for text containing Swedish and we use VARCHAR2 throughout but I couldn't tell you how the DB is set up regarding UTF8.

    I won't use lmgtfy but searching "nvarchar2 vs varchar2" did give this as a top entry which might help, if not I suggest you cross-post this question on SO and get an answer in about 5min
    Originally posted by MaryPoppins
    I'd still not breastfeed a nazi
    Originally posted by vetran
    Urine is quite nourishing

    Comment


      #3
      Originally posted by d000hg View Post
      Hmm. We use Oracle for text containing Swedish and we use VARCHAR2 throughout but I couldn't tell you how the DB is set up regarding UTF8.

      I won't use lmgtfy but searching "nvarchar2 vs varchar2" did give this as a top entry which might help, if not I suggest you cross-post this question on SO and get an answer in about 5min
      I did a search on google for this already and didn't get that link

      So it seems if your database is not UTF8 you can use NVARCHAR2 to store international characters. So by that theory, if your database is UTF8 you don't need NVARCHAR2.

      My brain hurts.
      Knock first as I might be balancing my chakras.

      Comment


        #4
        Try putting one of these: ☂ or these: 🚀 in there.

        Comment

        Working...
        X