Fw: AW: Problem with accents

[email protected]
Newsgroups gmane.comp.web.mnogosearch.general
Message-ID <OFA5B53A89.5BE15642-ONC12578BE.002CACD6-C12578BE.002D6C0C@iht.com>
I found a simpler solution to my charset problem:

- removed the mysql_query("SET NAMES ...") command from my php code 
because the database's default character set is latin1
- removed <meta http-equiv="Content-Type" content="text/html; 
charset=..."> from the php code because the server's default charset is 
iso-8859-1 alias latin1
- left the default LocalCharset and BrowserCharset variable values 
(iso-8859-1) untouched in search.htm

My charset problem was due to the fact that I forced both the database's 
and the browser page's charsets to utf8.

Philippe


----- Forwarded by Philippe De Rochambeau/PAR/IHTNEWS on 29/06/2011 10:07 
-----

Philippe De Rochambeau/PAR/IHTNEWS 
29/06/2011 09:55

To
[email protected]
cc
"Witte Marco" <[email protected]>
Subject
Fw: AW: Problem with accents





Marco,

I replaced

LocalCharset   iso-8859-1
BrowserCharset iso-8859-1

by 

LocalCharset   utf-8
BrowserCharset utf-8

in search.htm

and that solved my problem (ie, accented words not being displayed 
correctly in search.htm).

Many thanks for your help.

Best regards,

Philippe

----- Forwarded by Philippe De Rochambeau/PAR/IHTNEWS on 29/06/2011 09:53 
-----

Philippe De Rochambeau/PAR/IHTNEWS
29/06/2011 09:23

To
[email protected]
cc
"Witte Marco" <[email protected]>
Subject
Re: AW: Problem with accents





Hi,

I use UTF-8 in both my page 

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

and my database

mysql_query("SET NAMES 'utf8'");

My server serves iso-8859-1 characters by default.

Philippe





"Witte Marco" <[email protected]> 
29/06/2011 07:14

To
<[email protected]>
cc

Subject
AW: Problem with accents






Hi,
did you try to switch codepage within your Browser to UTF-8 / different 
settings?
In Firefox there are multiple options. 
In my case i had an iso-8859-1 statement within on headerfiles.
Is your http server serving utf-8 codepage per default?
 
Regards
Max
 

Von: [email protected] [mailto:[email protected]] 
Gesendet: Dienstag, 28. Juni 2011 18:16
An: [email protected]
Betreff: Problem with accents


Hello, 

the php script I am currently working on contains the following code 

while ( $bdict_row = mysql_fetch_assoc($bdict_result_id) ) 
{ 
        $the_word = $bdict_row['word']; 
        $href = "<a href=\"/mnogosearch/search.cgi?q=" 
                . rawurlencode($the_word) 
                . "\" target=\"_blank\">" 
                . $the_word . "</a>"; 

        .... 

        echo "<td\">$href</td></tr>\n<tr>"; 

        ... 


This code displays all words in the mnogosearch bdict table, as 
hyperlinks, on a web page. 

Whenever a hyperlinked word contains accented characters (eg, 
"bérangère"), the data which are passed to the search.cgi are invalid. 

For instance, let's say I click the "bérangère" hyperlink. As a result, 
the input field in the search.cgi form will contain the following value: 

 bérangère 

which is wrong. The value should be "bérangère". 

Thanks in advance for your help. 

Philippe 


PS I use the utf-8 charset in my database and on my webpage. 




P In order to preserve the environment, please do not print this message 
unless it is necessary.


P In order to preserve the environment, please do not print this message 
unless it is necessary.

P In order to preserve the environment, please do not print this message 
unless it is necessary.

P In order to preserve the environment, please do not print this message 
unless it is necessary.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.