dbTalk Databases Forums  

Re: Charset problem / PHP

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Re: Charset problem / PHP in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Álvaro G. Vicario
 
Posts: n/a

Default Re: Charset problem / PHP - 04-09-2008 , 06:43 AM






"Jens Müller" <usenet-11-2007 (AT) tessarakt (DOT) de> escribió en el mensaje
news:663o57F2iirkdU1 (AT) mid (DOT) individual.net...
Quote:
Oracle SQL developer correctly shows the text, but when I access the DB
with a PHP script, "emil-gött-straße" becomes "emil-gott-stra?e". Is there
a possibility to fix this with a function call or similiar in the PHP
script, without changing the webserver or database setup?
You have two pure PHP options:

1. Convert from DB charset to script charset. Have a look at iconv().
2. Convert to HTML entities. Have a look at htmlentities() with the charset
parameter.




Reply With Quote
  #2  
Old   
Malcolm Dew-Jones
 
Posts: n/a

Default Re: Charset problem / PHP - 04-09-2008 , 03:16 PM






=?ISO-8859-15?Q?Jens_M=FCller?= (usenet-11-2007 (AT) tessarakt (DOT) de) wrote:
: Álvaro G. Vicario schrieb:
: > "Jens Müller" <usenet-11-2007 (AT) tessarakt (DOT) de> escribió en el mensaje
: > news:663o57F2iirkdU1 (AT) mid (DOT) individual.net...
: >> Oracle SQL developer correctly shows the text, but when I access the DB
: >> with a PHP script, "emil-gött-straße" becomes "emil-gott-stra?e". Is there
: >> a possibility to fix this with a function call or similiar in the PHP
: >> script, without changing the webserver or database setup?
: >
: > You have two pure PHP options:
: >
: > 1. Convert from DB charset to script charset. Have a look at iconv().

: Any hint how to find out the DB charset first?

SELECT USERENV('LANGUAGE') FROM DUAL

select DUMP(column_name) can also be useful.

If you start with data saved on a disk, then DOS debug, or unix od is
useful to examine what unmolested byte values you were starting out with.

I have no suggestion for how to examine the binary byte-level values of
the data while you are manipulating it with php, but it would be good to
figure out how to dump that out to confirm the data inside your php
program has not been molested by some unexpected conversion.


Reply With Quote
  #3  
Old   
Malcolm Dew-Jones
 
Posts: n/a

Default Re: Charset problem / PHP - 04-09-2008 , 03:16 PM



=?ISO-8859-15?Q?Jens_M=FCller?= (usenet-11-2007 (AT) tessarakt (DOT) de) wrote:
: Álvaro G. Vicario schrieb:
: > "Jens Müller" <usenet-11-2007 (AT) tessarakt (DOT) de> escribió en el mensaje
: > news:663o57F2iirkdU1 (AT) mid (DOT) individual.net...
: >> Oracle SQL developer correctly shows the text, but when I access the DB
: >> with a PHP script, "emil-gött-straße" becomes "emil-gott-stra?e". Is there
: >> a possibility to fix this with a function call or similiar in the PHP
: >> script, without changing the webserver or database setup?
: >
: > You have two pure PHP options:
: >
: > 1. Convert from DB charset to script charset. Have a look at iconv().

: Any hint how to find out the DB charset first?

SELECT USERENV('LANGUAGE') FROM DUAL

select DUMP(column_name) can also be useful.

If you start with data saved on a disk, then DOS debug, or unix od is
useful to examine what unmolested byte values you were starting out with.

I have no suggestion for how to examine the binary byte-level values of
the data while you are manipulating it with php, but it would be good to
figure out how to dump that out to confirm the data inside your php
program has not been molested by some unexpected conversion.


Reply With Quote
  #4  
Old   
Malcolm Dew-Jones
 
Posts: n/a

Default Re: Charset problem / PHP - 04-09-2008 , 03:16 PM



=?ISO-8859-15?Q?Jens_M=FCller?= (usenet-11-2007 (AT) tessarakt (DOT) de) wrote:
: Álvaro G. Vicario schrieb:
: > "Jens Müller" <usenet-11-2007 (AT) tessarakt (DOT) de> escribió en el mensaje
: > news:663o57F2iirkdU1 (AT) mid (DOT) individual.net...
: >> Oracle SQL developer correctly shows the text, but when I access the DB
: >> with a PHP script, "emil-gött-straße" becomes "emil-gott-stra?e". Is there
: >> a possibility to fix this with a function call or similiar in the PHP
: >> script, without changing the webserver or database setup?
: >
: > You have two pure PHP options:
: >
: > 1. Convert from DB charset to script charset. Have a look at iconv().

: Any hint how to find out the DB charset first?

SELECT USERENV('LANGUAGE') FROM DUAL

select DUMP(column_name) can also be useful.

If you start with data saved on a disk, then DOS debug, or unix od is
useful to examine what unmolested byte values you were starting out with.

I have no suggestion for how to examine the binary byte-level values of
the data while you are manipulating it with php, but it would be good to
figure out how to dump that out to confirm the data inside your php
program has not been molested by some unexpected conversion.


Reply With Quote
  #5  
Old   
Malcolm Dew-Jones
 
Posts: n/a

Default Re: Charset problem / PHP - 04-09-2008 , 03:16 PM



=?ISO-8859-15?Q?Jens_M=FCller?= (usenet-11-2007 (AT) tessarakt (DOT) de) wrote:
: Álvaro G. Vicario schrieb:
: > "Jens Müller" <usenet-11-2007 (AT) tessarakt (DOT) de> escribió en el mensaje
: > news:663o57F2iirkdU1 (AT) mid (DOT) individual.net...
: >> Oracle SQL developer correctly shows the text, but when I access the DB
: >> with a PHP script, "emil-gött-straße" becomes "emil-gott-stra?e". Is there
: >> a possibility to fix this with a function call or similiar in the PHP
: >> script, without changing the webserver or database setup?
: >
: > You have two pure PHP options:
: >
: > 1. Convert from DB charset to script charset. Have a look at iconv().

: Any hint how to find out the DB charset first?

SELECT USERENV('LANGUAGE') FROM DUAL

select DUMP(column_name) can also be useful.

If you start with data saved on a disk, then DOS debug, or unix od is
useful to examine what unmolested byte values you were starting out with.

I have no suggestion for how to examine the binary byte-level values of
the data while you are manipulating it with php, but it would be good to
figure out how to dump that out to confirm the data inside your php
program has not been molested by some unexpected conversion.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.