2 Replies Latest reply: Mar 29, 2013 7:27 AM by Catch-22 RSS

    Shell Script -french characters are converting to junk in PLSQL

    Bharat_Hegde
      Hi All,

      I have plsql package. I have included few french word in it for validation purpose.
      When i compile this package from SQL Developr it is compiling properly.
      but when i run shell script from putty and try to comppile this package the package is errorring out.

      The reason for error out is it is converting few french characters into some junk characters. is there any setting for this.?

      Thanks
      Bharat
        • 1. Re: Shell Script -french characters are converting to junk in PLSQL
          bigdelboy
          Bharat wrote:
          Hi All,

          I have plsql package. I have included few french word in it for validation purpose.
          When i compile this package from SQL Developr it is compiling properly.
          but when i run shell script from putty and try to comppile this package the package is errorring out.

          The reason for error out is it is converting few french characters into some junk characters. is there any setting for this.?

          Thanks
          Bharat
          Your problems are in the are called globalization ( was called NLS)

          This can cause many problems, and is it extremely common for systems/applications/databases not be set up properly.

          Your script in SQLDeveloper is probably being held in the UTF8 characterset .... though I emphasize probably, and your file is probably saved as such.

          The oracle database, in whatever characterset that is in, let us call it CHARSET-DB, has however probably determined your sqlplus client is running a different characterset CHARSET-CLI and will perform a conversion from CHARSET-CLI to CHARSET-DB.

          Obviously if the Oracle Database has been led to falsely identify CHARSET-CLI then unwanted conversions can take place, however usually most (all?) charactersets are the same for most/all of 7-bit ASCII characters, so it is only things outside this that get affected. e.g. £, é, ó and lots of others.

          From a linux viewpoint the locale command and "LC*" variables may exert influence. However from an Oracle Client perspective the NLS_LANG variable is more effective.

          I suspect setting your NLS_LANG to UTF8 (e.g. NLS_LANG=AMERICAN_AMERICA.UTF8 ) and locale to US.UTF-8 or similar is likely to solve your issue.

          See below for a good document from OTN and a more specialist forum for this problem ( though there are some you use this forum who may be able to help you as well)

          http://www.oracle.com/technetwork/database/globalization/nls-lang-099431.html
          {forum:id=50}
          • 2. Re: Shell Script -french characters are converting to junk in PLSQL
            Catch-22
            I have included few french word in it for validation purpose.
            What does that mean? Can you give an example?

            ISO-8859-1 (8-bit) is standard for western European languages, including French. You can also use multibyte UTF-8, however, displaying and writing foreign language characters are two different things. The keyboard itself can only generate ASCII, so you need to shift the character set to 8-bit using a keyboard layout, or use software to translate and produce Unicode.

            The default $LANG setting in Linux is en_US.UTF-8, which you can modify to affect output, so you receive error message in French, for instance:
            $ echo $LANG
            en_US.UTF-8
            $ export LANG=fr_FR.UTF-8
            $ abc
            -bash: abc : commande introuvable
            I'm not a Windows user, but you may need to configure PuTTy to use the UTF-8 character set. I suggest to check the Window/Translation settings in the Putty application and set it to UTF-8 or whatever character set you need.