Following my previous question, I don't seem to be able to convert a HTTP response from ISO-8859-1
to UTF-8
.
I am using APEX_WEB_SERVICE
package to to my requests. (I know this package uses UTL_HTTP
itself, so it should be similar in usage)
What I do:
apex_web_service.g_request_headers(1).name := 'Content-Type';
apex_web_service.g_request_headers(1).value := 'text/csv';
l_response := apex_web_service.make_rest_request(
p_url => MY_URL || '/download_csv',
p_http_method => 'GET'
);
l_response
contains the csv data but all 'é'
and 'è'
are replaced by '¿'
:
Type;Groupe Acc¿Code;EOTP autoris¿Familles EOTP autoris¿;Nom;Pr¿m;Adresse
Whereas if I access the link directly, my browser downloads it with proper encoding:
Type;Groupe Accès;Code;EOTP autorisés;Familles EOTP autorisées;Nom;Prénom;Adresse
I tried to convert the response with:
l_response := convert(l_response, 'AL16UTF16', 'WE8ISO8859P1');
But it has absolutely no effect.
The website is https://www.stocknet.fr/ and is in ISO-8859-1
.
My Oracle NLS parameters (which I obviously can't modify):
+-------------------------+-----------------------------+
| PARAMETER | VALUE |
+-------------------------+-----------------------------+
| NLS_LANGUAGE | ENGLISH |
| NLS_TERRITORY | UNITED KINGDOM |
| NLS_CURRENCY | £ |
| NLS_ISO_CURRENCY | UNITED KINGDOM |
| NLS_NUMERIC_CHARACTERS | ., |
| NLS_CALENDAR | GREGORIAN |
| NLS_DATE_FORMAT | DD-MON-RR HH24:MI |
| NLS_DATE_LANGUAGE | ENGLISH |
| NLS_CHARACTERSET | WE8MSWIN1252 |
| NLS_SORT | BINARY |
| NLS_TIME_FORMAT | HH24.MI.SSXFF |
| NLS_TIMESTAMP_FORMAT | DD-MON-RR HH24.MI.SSXFF |
| NLS_TIME_TZ_FORMAT | HH24.MI.SSXFF TZR |
| NLS_TIMESTAMP_TZ_FORMAT | DD-MON-RR HH24.MI.SSXFF TZR |
| NLS_DUAL_CURRENCY | € |
| NLS_NCHAR_CHARACTERSET | AL16UTF16 |
| NLS_COMP | BINARY |
| NLS_LENGTH_SEMANTICS | BYTE |
| NLS_NCHAR_CONV_EXCP | FALSE |
+-------------------------+-----------------------------+
At this point, I don't know if there is any way to process data from this website from plsql. Any help, tips or suggestion would be appreciated.
'text/csv; charset=ISO-8859-1'
or'text/csv; charset=UTF-8'
– kfinity