Re: PHP + PostgreSQL: invalid byte sequence for encoding "UTF8"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

> 
> Well, I searched all the source code of phpPgAdmin for charsets and I found:
> 
> "echo "\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset={$data->codemap[$dbEncoding]}\" />\r\n";"
> 
> So this means, phpPgAdmin sets the output charset to the charset which
> is used by the databased connected to - but that's still not the
> problem, because I also know how to fix charset output in browsers.

Not exactly. As far as I can see, it only changes the value of the Content-type: header
in the HTML, it doesn't change the actual encoding output.

> > Once again indicating your data needs to be converted from some other
> > character set.
> 
> It's already converted to be compatible to utf8 when fetching it from some other ressources.

I didn't mean the content of the database,. I was referring to the data
that PHP is actually processing, which appears to have been converted
within PHP

> Well, I've set the default_charset to UTF8, it was set before to "" (empty) -
> but the output on console (cli) and the problem is still the same also
> after changing this to UTF8, so: this is not the problem, 
.
It should be "UTF-8", this is the official designation from unicode,
although case will likely be ignored. As far as I know "UTF8" is not a
recognised encoding
  This however, is only the value that will be output as the
Content-Type charset, as noted above.


> I fetch something from database, which looks like "lacarrière" when I output it in
> PHP - well don't let us get confused from PHPs output. Then I fetch
> something from another ressource looking like "lacarrière" - when I
> compare both strings in PHP it tells me that they are "not equal".

As I said before. Many of PHP's functions (the string one's for
comparing for example) are NOT multi-byte aware, so are NOT guaranteed
to work correctly.

You did not answer the most important question. What, if any, output
buffering are you using?  Are you using the mbstring module?  If so, is
it set to overload the old string functions?

--
Niel Archer

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux