Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    Jun 2004
    Posts
    23

    Unhappy Unanswered: Language Charset Encoding Problems

    Hi,

    i have Oracle 9i with developer suite installed in my 2000 professional Box my local language is ARABIC which use win1256 charset, when i run my Forms & reports all Arabic characters appears as ???????????????
    What should i do to correct this problem, and is there any methods should be done while Developer or Oracle Installation to make my Arabic characters appears clearly ?

    when i install the database i choose ARABIC Windows-1256 chracter set !

    where can i change my database character set, and what is the best character set for me in my explorer i use Windows-1256 ?

    and did the Registry file NLS_LANG located in my windows Registry.

    affect my database Charset !?? now this value is null.

    Thanks

  2. #2
    Join Date
    Aug 2004
    Location
    France
    Posts
    754
    Hello,

    No, NLS_LANG does not affect your database charset, but it affects your client charset, and if Oracle detects another charset on the client than the one in the database, then it tries to convert data from the database charset to the client charset. So, NLS_LANG is essential. (and I think that the default value is AMERICAN_AMERICA.US7ASCII, which explains your ??????? when converting 7-bits ASCII to arabic)

    Try this value on the client :

    NLS_LANG=.AR8MSWIN1256

    The NLS_LANG structure is generally language_territory.charset, but all are optional. Just put _ before a territory and . before charset. The above value only sets the character set, but you could also put something like :

    NLS_LANG=ARABIC_ALGERIA.AR8MSWIN1256

    Hope that helps.

    Regards,

    RBARAER

  3. #3
    Join Date
    Jun 2004
    Posts
    23

    Wink very thanks

    Thanks Mr.RBARAER for help the problem is almost finished. now i can read My locale clearly through database or Form (Client).

    but do have an idea why the old data in my database still not changed !?
    I mean after i editi the Nls_LANG erevy thing is Ok just for the new Entered Data But the Existing data Still not changed it seems like ??????? ( upsite down)

    and when doing import from an old data base Or afull DMP file did the new NLS_LANG charset affect the Imported data !!

    Very thanks for help

  4. #4
    Join Date
    Aug 2004
    Location
    France
    Posts
    754
    I'm glad it helped.

    Data entered through your form with your old NLS_LANG is incorrect in your DB because Oracle interpreted what you entered on the client as US7ASCII (while it was in the win1256 charset), and so tried to convert the input in the DB charset (AR8MSWIN1256), with no luck. You can try to convert these entries explicitly using an update statement, but I'm not sure of the result (because the wrong convert attempt may have messed up data) :

    Code:
    UPDATE your_table 
    SET your_textfield=CONVERT(your_textfield, 'AR8MSWIN1256', 'US7ASCII');
    You can first try that to see if the above query will work :
    Code:
    SELECT CONVERT(your_textfield, 'AR8MSWIN1256', 'US7ASCII')
    FROM your_table;
    If this does not work, I don't see how you could get your old data back and correct.

    I don't think NLS_LANG plays a role in exports/imports : the character set is, as far as I know, written in the DMP, but I'm not sure.

    Regards,

    RBARAER

  5. #5
    Join Date
    Jun 2004
    Posts
    23

    Red face hi

    i try the convertion script but it return the same unknown character ?????????


    SQL> SELECT CONVERT(bank, 'AR8MSWIN1256', 'US7ASCII') FROM chk1;

    CONVERT(BANK,'AR8MSWIN1256','US7ASCII')
    --------------------------------------------------------------------------------
    ???????
    ??? ??????? ??????

    SQL>

  6. #6
    Join Date
    Jun 2004
    Posts
    23

    Red face Solution

    I think i get Solution why not change the NLS_LANG file in the source database to match the destination Dbase Character set and then i do the export from there and the Import here

    I get this:

    1) change the environment variable of NLS_LANG to that of your target database:

    echo $NLS_LANG
    export NLS_LANG=ARABIC_ALGERIA.AR8MSWIN1256
    echo $NLS_LANG
    ARABIC_ALGERIA.AR8MSWIN1256

    2) do your export. You should see something like this before the data starts to get exported:

    Export done in AR8MSWIN1256 character set and UTF8 NCHAR character set
    server uses UTF8 character set (possible charset conversion)

    3) now you should be able to import the dmp file into your target database.

    Conversely you can do this on the import too. Change the NLS_LANG variable before importing and this should convert the dmp file but I personally think it's easier doing this on the export.

    In Windows (dos really) you do:

    set NLS_LANG=ARABIC_ALGERIA.AR8MSWIN1256

    Then do the export.

  7. #7
    Join Date
    Aug 2004
    Location
    France
    Posts
    754
    Ok, that would mean that NLS_LANG influences imports/exports. Please let me know if it's the case.

    Anyway, since your data was wrongly converted between your client and the DB, as I already said, I fear your data has been corrupted, which would mean that you can't get it back and correct...

    Please let me know if you succeed.

    Regards,

    RBARAER

  8. #8
    Join Date
    Jun 2004
    Posts
    23

    why

    Mr.RBARAER

    do u have an Idea why Oracle 8 work fine with the AMIRECAN_AMERICAN encoding in my NLS_LANG while my locale is ARABIC_EGYPT.AR8MSWIN1256 AND not the Oracle 9i !!!

    i didn't try the last solution yet but sooner will post.

  9. #9
    Join Date
    Aug 2004
    Location
    France
    Posts
    754
    No, sorry, I don't know. I've only worked on 9i so far.

    However, be careful that NLS_LANG=AMERICAN_AMERICA doesn't specify the character set to be used, just language and territory, which influence other parameters (such as date format, linguistic sorting...). As far as I know, you can set up NLS_LANG=AMERICAN_AMERICA.AR8MSWIN1256 (though I'm not sure). In 9i, the default character set should be US7ASCII, but in Oracle 8, I don't know.

    However, please be a little more accurate and I'll try to help you understand on that Oracle 8 working fine : what are your NLS_LANG values on the client and on the server (on the server, it should do nothing unless you run the client on the server ), and what is the DB charset.

    Regards,

    RBARAER

  10. #10
    Join Date
    Jun 2004
    Posts
    23

    Hi

    Mr RBARAER,
    will told you all the problem.

    I have about 35 Stand alone Different Oracle 8 system work in Different PC's
    iT work very fine with no problem even i didn't need to update or adjust my NLS_LANG the default value in my NLS_LANG as i check it later is AMERICAN_AMIRECAN.ISO* (Not remember) and it work fine, the system using English USA AS default with Arabic as aditional language.
    Now i just Installed The O9i in Single PC and AS you know the encoding problem occured when i enter in new database ARABIC chracter, the problem solved by Modifying the NLS_LANG to ARABIC_EGYPT.AR8MSWIN1256 and i success in Entering new data in My local Language (Arabic) , so no problem to Install the Oracle9 in Other PC but what about the Existance databases i have to Migrate them to 9i the same problem Occured The dummbed and Imported data in to the New Oracle 9 database Look like (????????????) !!!

    my current problem as you know is how can i import the my data to Ora9i system without crashing the data.

    Thats ALL.

  11. #11
    Join Date
    Aug 2004
    Location
    France
    Posts
    754
    Ok, concerning exports/imports, I've read some Oracle documentation and here is what should be interesting for you :

    Whenever you are moving data between different releases of the Oracle database server, the following basic rules apply:

    - The Import utility and the database to which data is being imported (the target database) must be the same version.

    - The version of the Export utility must be equal to the lowest version of the
    source or target database.
    So for your : use the 8i export and 9i import utilities.
    The Export utility always exports user data, including Unicode data, in the
    character sets of the Export server. The character sets are specified at database creation.
    The Import utility automatically converts the data to the character sets of the Import server.
    So as long as the characteer sets in both servers (8i and 9i) are the same, you should not have any problem. You should check if they are exactly the same. As I expected, according to the Oracle documentation, NLS_LANG does not interfere with exports/imports.

    I hope it will help you.

    Regards,

    RBARAER

  12. #12
    Join Date
    Jun 2004
    Posts
    23

    Unhappy 8i not 8

    Thanks alot Dear RBARAER for the Valuable Info,
    So I have to Use The 8i not the 8 !!?? to Export my data.

    So as long as the characteer sets in both servers (8i and 9i) are the same, you should not have any problem. You should check if they are exactly the same.
    The problem Occure first time after i installed the 9i and made new database, when i enter my first arabic word after the commit it appears as (????? )
    that happen when i'm using the same as Oracle 8 Encoding then i change the 9i pc Encoding to ARABIC_EGYPT.AR8MSWIN1256 my new entered data commited and appears OK in arabic. so how can the Source and the distination Encoding Be thge same

    Source ---> Oracle 8(AMERICAN_AMERICA.WEISO8859)
    Distination ---> Oracle 9i (ARABIC_EGYPT.AR8MSWIN1256)

    when i change the Source encoding to (ARABIC_EGYPT.AR8MSWIN1256)
    All the data Appears ????????????? so i can't export It. and also when i change the Destination to (AMERICAN_AMERICA.WEISO8859) The data Looks like ??????? too

    Thanks alot for help
    waiting...

  13. #13
    Join Date
    Jun 2004
    Posts
    23

    Red face I get this

    Can one import/export between different versions of Oracle?
    Different versions of the import utility is upwards compatible. This means that one can take an export file created from an old export version, and import it using a later version of the import utility. This is quite an effective way of upgrading a database from one release of Oracle to the next.

    Oracle also ships some previous catexpX.sql scripts that can be executed as user SYS enabling older imp/exp versions to work (for backwards compatibility). For example, one can run $ORACLE_HOME/rdbms/admin/catexp7.sql on an Oracle 8 database to allow the Oracle 7.3 exp/imp utilities to run against an Oracle 8 database.
    http://www.orafaq.com/faqiexp.htm

  14. #14
    Join Date
    Aug 2004
    Location
    France
    Posts
    754
    Hello mojtaba,

    So, did you succeed ?

    Regards,

    RBARAER

  15. #15
    Join Date
    Jun 2004
    Posts
    23

    Talking hi

    HELLO ,

    Finally ORACLE 8i completely solve the problem.
    I export my databse from 8.0.5 to 8i using the imp80
    the character is appears fine then i use the exporter for the 8i to
    9i and i got it ok.



    thanks dear for help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •