1 2 Previous Next 18 Replies Latest reply on Apr 19, 2011 8:28 AM by Klaus Sch.

    Standalone Listener 1.1 characterset problems

    Klaus Sch.
      Hi,

      I have downloaded and installed the "OTN Developer Day VM March '11 Edition" with Apex 4.0.2 and Apex listener 1.1.
      While trying out Apex with the pre-installed standalone listener I realized that it is impossible to save any german umlaut.
      When inserting "Büro" I get displayed "Büro" after submit.
      When using SQL-Developer and plain SQL insert statement, I get the umlaut displayed in my Apex application.
      After reading some hints in this forum I added "-Dfile.encoding=UTF8" to the java options in "apexlistener.sh":
      OPTIONS="-Xmx1024m -Xms256m -Dapex.port=8888 -Djava.io.tmpdir=/home/oracle/tmp *-Dfile.encoding=UTF8* -jar $APEXWAR 2>&1 >/tmp/apexListener.log"
      But there is no difference: no umlauts after insert.

      Any idea?
      Klaus
        • 1. Re: Standalone Listener 1.1 characterset problems
          Udo
          Hi Klaus,

          I haven't installed that VM (yet). Do you have UTF8 for the locales (NLS- and/or LC-parameters) as well? Or is it some WE8ISO8859P1 or WE8ISO8859P15? If it works in the SQL Developer, you could simply try to use the same settings you have in that environment.

          -Udo
          • 2. Re: Standalone Listener 1.1 characterset problems
            Klaus Sch.
            Hi Udo,

            I am using Apex with my local Firefox running under Windows 7 accessing the Oracle VM running under Virtualbox on the same machine.
            The database parameter is set to NLS_CHARACTERSET=AL32UTF8.
            Firefox under Windows was configured to de_DE using ISO-8895-15. I changed the settings to UTF-8, but it makes no difference.

            I tried out Firefox installed inside the VM on the Virtualbox Console with en_US UTF-8 - still the same.

            With the same browser settings I have access to other Apex environments having the Oracle http Server installed.
            Umlauts can be inserted and displayed.

            Unexpectly I can use Apex's SQL-Workshop without any problem. All umlauts can be used in plain SQL.

            Klaus
            • 3. Re: Standalone Listener 1.1 characterset problems
              Udo
              Hi Klaus,

              what about the environment variables of the OS-user on whose behalf the APEX Listener is being executed? This would be the shell environment in the VM's OEL.
              Did you install your OHS in that VM, too?

              -Udo
              • 4. Re: Standalone Listener 1.1 characterset problems
                Klaus Sch.
                Hi Udo,

                in the VM the listener is started from the oracle account where NLS_LANG is not set be default.
                I added "export NLS_LANG=AMERICAN_AMERICA.AL32UTF8" to the startscript "apexlistener.sh", but nothing changed after restart.
                $LANG is set to "en_US.UTF-8".

                The OHS is running on a different machine with SuSE SLES 11 and Oracle 11gR2.

                Klaus
                • 5. Re: Standalone Listener 1.1 characterset problems
                  Udo
                  Hi Klaus,

                  did you try to change the value for LANG to a German charset, e.g. "de_DE.UTF-8"?
                  On my box (though not running the standalone Listener) I use "LANG=de_DE@euro" and additionally the Java parameter "-Djava.encoding=UTF-8" and have neither problems with umlauts nor with EURO-signs.

                  -Udo

                  P.S. I just read your previous post again and saw you set "UTF8" for "file.encoding". Could you try to change that value to "UTF-8".
                  • 6. Re: Standalone Listener 1.1 characterset problems
                    Klaus Sch.
                    Hi Udo,

                    I tried the following values in the startscript "apexlistener.sh":
                    export LANG=de_DE@euro
                    export NLS_LANG=GERMAN_GERMANY.AL32UTF8
                    OPTIONS="-Xmx1024m -Xms256m -Dapex.port=8888 -Djava.io.tmpdir=/home/oracle/tmp -Dfile.encoding=UTF-8 -jar $APEXWAR 2>&1 >/tmp/apexListener.log"

                    But after restarting the behaviour is unchanged: still no umlaut.

                    Klaus
                    • 7. Re: Standalone Listener 1.1 characterset problems
                      Udo
                      Hi Klaus,

                      did you also try to set "java.encoding" (see message above).

                      -Udo
                      • 8. Re: Standalone Listener 1.1 characterset problems
                        731174
                        Hi Klaus

                        Do You resolve this?

                        I try run standalone listner for testing and I get the same problem but with EE8MSWIN1250 characterset.

                        On the same machine i have WebLogic Server (11g) with Listener 1.0 deployed and everything works fine.

                        Oskar
                        • 9. Re: Standalone Listener 1.1 characterset problems
                          Klaus Sch.
                          Hi Udo,

                          I tried both options -Dfile.encoding=UTF-8 and -Djava.encoding=UTF-8, alone and together.

                          Nothing changed.

                          I had the idea it could be a problem with encoding via jdbc. So I changed the parameters in the listener configuration file apex-config.xml to make use of tnsnames.
                          But this did not help either.

                          Klaus
                          • 10. Re: Standalone Listener 1.1 characterset problems
                            Klaus Sch.
                            Hi Oskar,

                            I still have not found a way to input umlauts using Apex and the standalone listener.
                            With other configurations (modplsql, tomat + apexlistener, XE 11g beta) there is no problem.

                            Klaus
                            • 11. Re: Standalone Listener 1.1 characterset problems
                              Udo
                              Hi Klaus,

                              that's odd.
                              I'm also still confused that the SQL Workshop doesn't show this behaviour. This indicates that it's no general issue with the Listener. I still think it's some "environmental" issue that others like OHS don't have to care about.
                              Which is your default applicaiton language? And which language do you use for APEX in general, especially when calling the SQL Workshop?
                              Unfortunately, I still don't have enough time to install that VM (or, to be more precise, Oracle VM Virtual Box - we still use VMWare) on one of my machines. It has to be something very small, but small things are often the hardest to spot...

                              -Udo
                              • 12. Re: Standalone Listener 1.1 characterset problems
                                Klaus Sch.
                                Hi Udo,

                                I am using the Appliance with the default settings.
                                That means:
                                - language en when logging in to my workspace (there is no additional language installed)
                                - Application Primary Language: English (en)

                                Accessing the application from remote with
                                - Firefox 3.6.16 Language setting: [en-us]
                                Encoding: Unicode (UTF-8)
                                - Windows 7 de_DE
                                I am using the same settings for other Apex-Instances like apex.oracle.com including Umlauts.

                                The behaviour is the same on the X-windows screen of the Oracle VM.

                                apexlistener.sh
                                -------------------
                                ...
                                export LANG=en_US.UTF-8
                                export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
                                OPTIONS="-Xmx1024m -Xms256m -Dapex.port=8888 -Djava.io.tmpdir=/home/oracle/tmp -Dfile.encoding=UTF-8 -jar $APEXWAR 2>&1 >/tmp/apexListener.log"
                                ...


                                Java system properties for the apexlistener:
                                -----------------------------------------
                                java.runtime.name=Java(TM) SE Runtime Environment
                                sun.boot.library.path=/usr/java/jdk1.6.0_20/jre/lib/i386
                                java.vm.version=16.3-b01
                                java.vm.vendor=Sun Microsystems Inc.
                                java.vendor.url=http://java.sun.com/
                                path.separator=:
                                java.vm.name=Java HotSpot(TM) Client VM
                                file.encoding.pkg=sun.io
                                user.country=US
                                sun.java.launcher=SUN_STANDARD
                                sun.os.patch.level=unknown
                                java.vm.specification.name=Java Virtual Machine Specification
                                user.dir=/home/oracle/tmp
                                java.runtime.version=1.6.0_20-b02
                                java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
                                java.endorsed.dirs=/usr/java/jdk1.6.0_20/jre/lib/endorsed
                                os.arch=i386
                                java.io.tmpdir=/tmp
                                line.separator=

                                java.vm.specification.vendor=Sun Microsystems Inc.
                                os.name=Linux
                                sun.jnu.encoding=UTF-8
                                java.library.path=/usr/java/jdk1.6.0_20/jre/lib/i386/cl...
                                java.specification.name=Java Platform API Specification
                                java.class.version=50.0
                                sun.management.compiler=HotSpot Client Compiler
                                os.version=2.6.18-194.17.1.0.1.el5
                                user.home=/home/oracle
                                user.timezone=
                                java.awt.printerjob=sun.print.PSPrinterJob
                                file.encoding=UTF-8
                                java.specification.version=1.6
                                user.name=oracle
                                java.class.path=/home/oracle/app/oracle/product/Times...
                                java.vm.specification.version=1.0
                                sun.arch.data.model=32
                                java.home=/usr/java/jdk1.6.0_20/jre
                                java.specification.vendor=Sun Microsystems Inc.
                                user.language=en
                                java.vm.info=mixed mode, sharing
                                java.version=1.6.0_20
                                java.ext.dirs=/usr/java/jdk1.6.0_20/jre/lib/ext:/us...
                                sun.boot.class.path=/usr/java/jdk1.6.0_20/jre/lib/resourc...
                                java.vendor=Sun Microsystems Inc.
                                file.separator=/
                                java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport...
                                sun.cpu.endian=little
                                sun.io.unicode.encoding=UnicodeLittle
                                sun.cpu.isalist=
                                -----------------------------------------

                                Klaus
                                • 13. Re: Standalone Listener 1.1 characterset problems
                                  Colm Divilly-Oracle
                                  Hi Klaus,
                                  can you provide steps to reproduce this problem, is this occurring during data entry in an APEX application, using a Resource Template, or invoking a stored procedure?

                                  Thanks
                                  • 14. Re: Standalone Listener 1.1 characterset problems
                                    Klaus Sch.
                                    Hi Colm,

                                    to make it simple I have created a testcase as follows

                                    I created a Table, Sequence, Trigger using SQL-Workshop
                                    create sequence test_umlaut_seq increment by 1 start with 3 nocache;
                                    
                                    create table test_umlaut (id number, umlaut varchar2(3 CHAR), ascii number);
                                    
                                    alter table test_umlaut add constraint test_umlaut_pk primary key (id) using index;
                                    
                                    create or replace
                                    TRIGGER biu_test_umlaut
                                     BEFORE
                                      INSERT OR UPDATE
                                     ON test_umlaut
                                    REFERENCING NEW AS NEW OLD AS OLD
                                     FOR EACH ROW
                                    BEGIN
                                      IF inserting
                                      THEN
                                        IF :NEW.id IS NULL
                                        THEN
                                          :NEW.id := test_umlaut_seq.nextval;
                                        END IF;
                                      END IF;
                                    
                                      IF :NEW.ascii IS NULL
                                      THEN
                                        :NEW.ascii := ascii(:NEW.umlaut);
                                      END IF;
                                    
                                    EXCEPTION
                                      WHEN others THEN
                                        raise_application_error
                                          (-20042, $$plsql_unit||': '|| DBMS_UTILITY.format_error_backtrace
                                                                     || DBMS_UTILITY.format_error_stack);
                                    END;
                                    /
                                    
                                    insert into test_umlaut values (1, 'ü', 50108);
                                    insert into test_umlaut values (2, chr(50108), 50108);
                                    
                                    commit;
                                    Then I created a database application from scratch -> Report + Form, Table TEST_UMLAUT, Interactive Report, Theme 21

                                    When running the application I get two previously created records with the correctly displayed umlaut "ü".
                                    After creating a new record by hitting the same key "ü" on my keyboard I have used for the first record there is not the correct umlaut.
                                    Instead I receive "ü".
                                    select id
                                         , umlaut
                                         , length(umlaut) chars
                                         , lengthb(umlaut) bytes
                                         , ascii(umlaut) pos1
                                         , ascii(substr(umlaut,2,1)) pos2
                                      from test_umlaut;
                                    Result
                                    ID UML CHARS BYTES  POS1  POS2
                                    -- --- ----- ----- ----- -----
                                     1 ü       1     2 50108
                                     2 ü       1     2 50108
                                     3 ü      2     4 50051 49852
                                    Regards
                                    Klaus
                                    1 2 Previous Next