This discussion is archived
1 Reply Latest reply: Jul 25, 2012 7:23 PM by Sergiusz Wolicki (Oracle) RSS

Encoding issue

Tomeo Newbie
Currently Being Moderated
Hi folks,

I run a below query in server's SQL*PLUS:
select xml
 from
   (  select 
            httpuritype('http://maps.googleapis.com/maps/api/geocode/xml?latlng=49.059042,17.454431&sensor=false').getXML() xml
      from dual
    )      
    
   select x.formatted_address
    from dual d
         ,XMLTABLE('/GeocodeResponse/result'
                    PASSING httpuritype('http://maps.googleapis.com/maps/api/geocode/xml?latlng=50.084463,14.433174&sensor=false&language=cs').getXML()
                    COLUMNS 
                       formatted_address varchar2(100) PATH 'formatted_address'
                    )  x
   where rownum = 1   
Result which I get displays a not supported characters due to some encoding problem.
 
Connected to:
Oracle Database 11g Release 11.2.0.1.0 - 64bit Production

SQL> set define off;
SQL> select xml
  2   from
  3     (  select
  4              httpuritype('http://maps.googleapis.com/maps/api/geocode/xml?latlng=49.059042,17.454431&sensor=false').getXML() xml
  5        from dual
  6      )
  7
SQL>    select x.formatted_address
  2      from dual d
  3           ,XMLTABLE('/GeocodeResponse/result'
  4                      PASSING httpuritype('http://maps.googleapis.com/maps/api/geocode/xml?latlng=50.084463,14.433174&sensor=false&language=cs').getXML()
  5                      COLUMNS
  6                         formatted_address varchar2(100) PATH 'formatted_address'
  7                      )  x
  8     where rownum = 1   ;

FORMATTED_ADDRESS
--------------------------------------------------------------------------------
Opletalova 1336/35, 110 00 Praha-Praha 1, Česká republika

SQL>
A correct output should be:
FORMATTED_ADDRESS
--------------------------------------------------------------------------------
Opletalova 1336/35, 110 00 Praha-Praha 1, Česká republika

SQL>
Any idea?


Here are my NLS settings:

NLS_DATABASE_PARAMETERS
SQL> select * from NLS_DATABASE_PARAMETERS;

PARAMETER                      VALUE
------------------------------ ----------------------------------------
NLS_LANGUAGE                   AMERICAN
NLS_TERRITORY                  AMERICA
NLS_CURRENCY                   $
NLS_ISO_CURRENCY               AMERICA
NLS_NUMERIC_CHARACTERS         .,
NLS_CHARACTERSET               EE8MSWIN1250
NLS_CALENDAR                   GREGORIAN
NLS_DATE_FORMAT                DD-MON-RR
NLS_DATE_LANGUAGE              AMERICAN
NLS_SORT                       BINARY
NLS_TIME_FORMAT                HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT           DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT             HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT        DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY              $
NLS_COMP                       BINARY
NLS_LENGTH_SEMANTICS           BYTE
NLS_NCHAR_CONV_EXCP            FALSE
NLS_NCHAR_CHARACTERSET         AL16UTF16
NLS_RDBMS_VERSION              11.2.0.1.0

20 rows selected.
SQL> select * from NLS_SESSION_PARAMETERS;

PARAMETER                      VALUE
------------------------------ ----------------------------------------
NLS_LANGUAGE                   ENGLISH
NLS_TERRITORY                  CZECH REPUBLIC
NLS_CURRENCY                   KŔ
NLS_ISO_CURRENCY               CZECH REPUBLIC
NLS_NUMERIC_CHARACTERS         .,
NLS_CALENDAR                   GREGORIAN
NLS_DATE_FORMAT                DD.MM.RR
NLS_DATE_LANGUAGE              ENGLISH
NLS_SORT                       BINARY
NLS_TIME_FORMAT                HH24:MI:SSXFF
NLS_TIMESTAMP_FORMAT           DD.MM.RR HH24:MI:SSXFF
NLS_TIME_TZ_FORMAT             HH24:MI:SSXFF TZR
NLS_TIMESTAMP_TZ_FORMAT        DD.MM.RR HH24:MI:SSXFF TZR
NLS_DUAL_CURRENCY              KŔ
NLS_COMP                       BINARY
NLS_LENGTH_SEMANTICS           BYTE
NLS_NCHAR_CONV_EXCP            FALSE

17 rows selected.

SQL>
Could you please help me with a correct settings?

Kind regards,
Tomas

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points