473,404 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

utf8 output from database

Hi,

I'm having problems outputting data from my MySQL database. The output
should be Playa del inglés but instead I get ... Playa Del Ingl?s. I've
tried utf8_encode(), but this just converts to Playa Del Inglă©s.

Any advice? It seems to show fine in PHPMyadmin.

Thanks
Nov 22 '05 #1
8 2090
elyob wrote:
Hi,

I'm having problems outputting data from my MySQL database. The output
should be Playa del inglés but instead I get ... Playa Del Ingl?s. I've
tried utf8_encode(), but this just converts to Playa Del Inglă©s.

Any advice? It seems to show fine in PHPMyadmin.

Thanks


Hi, elyob,

Are you using an HTML charset that displays the "é"?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 22 '05 #2

"Jerry Stuckle" <js*******@attglobal.net> wrote in message
news:-s********************@comcast.com...
elyob wrote:
Hi,

I'm having problems outputting data from my MySQL database. The output
should be Playa del inglés but instead I get ... Playa Del Ingl?s. I've
tried utf8_encode(), but this just converts to Playa Del Inglă©s.

Any advice? It seems to show fine in PHPMyadmin.

Thanks


Hi, elyob,

Are you using an HTML charset that displays the "é"?


I thought so ...
Nov 22 '05 #3

"elyob" <ne*********@gmail.com> wrote in message
news:43********@news1.homechoice.co.uk...

"Jerry Stuckle" <js*******@attglobal.net> wrote in message
news:-s********************@comcast.com...
elyob wrote:
Hi,

I'm having problems outputting data from my MySQL database. The output
should be Playa del inglés but instead I get ... Playa Del Ingl?s. I've
tried utf8_encode(), but this just converts to Playa Del Inglă©s.

Any advice? It seems to show fine in PHPMyadmin.

Thanks


Hi, elyob,

Are you using an HTML charset that displays the "é"?


I thought so ...

<meta http-equiv="content-type" content="text/html;charset=utf-8" />
Nov 22 '05 #4
elyob wrote:
"elyob" <ne*********@gmail.com> wrote in message
news:43********@news1.homechoice.co.uk...
"Jerry Stuckle" <js*******@attglobal.net> wrote in message
news:-s********************@comcast.com...
elyob wrote:

Hi,

I'm having problems outputting data from my MySQL database. The output
should be Playa del inglés but instead I get ... Playa Del Ingl?s. I've
tried utf8_encode(), but this just converts to Playa Del Inglă©s.

Any advice? It seems to show fine in PHPMyadmin.

Thanks

Hi, elyob,

Are you using an HTML charset that displays the "é"?


I thought so ...


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


I'm going to show my ignorance of foreign languages here - is this
Italian, French or what? And what's the hex value of the character?

I have seen other problems like this; it's generally the charset isn't
set up to display that particular character. And I'm not sure UTF-8
will do it.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 22 '05 #5
elyob wrote:
"elyob" <ne*********@gmail.com> wrote in message
news:43********@news1.homechoice.co.uk...
"Jerry Stuckle" <js*******@attglobal.net> wrote in message
news:-s********************@comcast.com...
elyob wrote:

Hi,

I'm having problems outputting data from my MySQL database. The output
should be Playa del inglés but instead I get ... Playa Del Ingl?s. I've
tried utf8_encode(), but this just converts to Playa Del Inglă©s.

Any advice? It seems to show fine in PHPMyadmin.

Thanks

Hi, elyob,

Are you using an HTML charset that displays the "é"?


I thought so ...


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


One other thing - what happens if you use iso-8859-1?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 22 '05 #6
In article <L8********************@comcast.com>,
Jerry Stuckle <js*******@attglobal.net> wrote:

[...]
I have seen other problems like this; it's generally the charset isn't
set up to display that particular character. And I'm not sure UTF-8
will do it.


The charset parameter doesn't 'do' anything. It simply claims which
character repertoire applies. If the content is utf-8, the charset
should say so. If the content is for example mac-roman, claiming
"charset=utf-8" doesn't *make* it utf-8. You'll need to transliterate to
utf-8 first.

Thus, you need to always, in this order,
- know what character repertoire your original content is in
- optionally transliterate to another character repertoire
- ensure all tools you use handle that character repertoire properly
- provide the correct charset value to let user-agents know how to
handle the data

--
Sander Tekelenburg, <http://www.euronet.nl/~tekelenb/>

Mac user: "Macs only have 40 viruses, tops!"
PC user: "SEE! Not even the virus writers support Macs!"
Nov 22 '05 #7
On Tue, 15 Nov 2005 14:59:17 -0000, "elyob" <ne*********@gmail.com> wrote:
<meta http-equiv="content-type" content="text/html;charset=utf-8" />


PHP is a server-side programming language, and so is capable of outputting
real HTTP headers. These are by far more preferable to meta Content-type
headers, which are more useful for storage media that don't have separate
metadata - i.e. when just dumped to a filesystem.

<?php header("Content-type: text/html;charset=utf-8"); ?.

... is much more likely to cause the browser to accept the encoding of the
page as UTF-8.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Nov 22 '05 #8
On Tue, 15 Nov 2005 12:05:32 -0000, "elyob" <ne*********@gmail.com> wrote:
I'm having problems outputting data from my MySQL database. The output
should be Playa del inglés but instead I get ... Playa Del Ingl?s. I've
tried utf8_encode(), but this just converts to Playa Del Inglă©s.

Any advice? It seems to show fine in PHPMyadmin.


What is the encoding of the page in PHPMyAdmin?

(Right click, View Page Info in Firefox)

How does the character appear in the page source in PHPMyAdmin? Is it encoded
as an HTML character entity (&eacute; or something like that), or output
directly?

The key with solving character encoding issues is knowing exactly how
characters have been stored and encoded at every point in the system - from
initial input, stored in the database, any conversions on fetching from the
database, and on output to the final page. Once you lose track of the encoding
then you are in trouble.
--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Nov 22 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: sinasalek | last post by:
i have a problem with MySQL 4.1.x and UTF8. in version 4.0, i'm using html forms with utf8 charset for inserting unicode strings. but in version 4.1.x it is not working! if i change the charset of...
6
by: Spamtrap | last post by:
I only work in Perl occasionaly, and have been searching for a solution for a conversion, and everything I found seems much too complex. All I need to do is take a simple text file and copy...
1
by: ryang | last post by:
I am trying to understand how to work with Unicode in Perl. I have read the relevant man pages (perluniintro, perlunicode, etc.) and have written severl scripts to test/verifiy my understanding. ...
0
by: Sean | last post by:
I have a MySQL 4.1.11 database, table and table columns all configured as utf8 as I need to accept data in a number of languages. The MySQL database is hosted so I use SET NAMES utf8 in the...
4
by: EmeraldShield | last post by:
(Dot Net 2 C# application - using Encoding.UTF8 with a StreamReader) I have a very strange problem that I cannot explain with a UTF8 Readline() although this could exist in other types of encoding,...
4
by: weheh | last post by:
I'm developing a cgi-bin application that must be unicode sensitive. I'm striving for a UTF8 implementation. I'm running python 2.3 on a development machine (windows xp) and a server (windows xp...
0
by: damonwischik | last post by:
I use emacs 22 and python-mode. Emacs can display utf8 characters (e.g. when I open a utf8-encoded file with Chinese, those characters show up fine), and I'd like to see utf8-encoded output from my...
39
by: alex | last post by:
I've converted a latin1 database I have to utf8. The process has been: # mysqldump -u root -p --default-character-set=latin1 -c --insert-ignore --skip-set-charset mydb mydb.sql # iconv -f...
1
by: Server Applications | last post by:
Hello I am trying to build a system where I can full-text index documents with UTF8 or UTF16 data using Oracle Text. I am doing the filtering in a third-party component outside the database, so...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.