List:General Discussion« Previous MessageNext Message »
From:Werner Stuerenburg Date:August 3 2001 10:45am
Subject:Re: MySQL and CharSets
View as plain text  

Bernhard Doebler schrieb am Freitag, 3. August 2001, 08:40:35:

> I import a CSV file into MySQL using LOAD DATA INFILE. That's no problem. The problem
> is the textfile contains German umlauts. When I query the table with MySQL-program on the
> console (SQL monitor)
> it even works fine.
> But when I output in PHP it only shows the correct characters if I send header 
> header("Content-type: text/html; charset=IBM850");
> I don't want to use charset IBM850 but ISO-8859-1. How to convert the umlauts. Why
> are they different in both charsets?


So play save, you would not like to depend on character sets at
all.  I don't deal directly with output, send anything through a
function instead.  This function simply converts all non-seven
bit characters to HTML entities.  Remember, HTML was intended to
produce the same output regardless of the system used.

There is a function in php proper, but for some reason I don't
remember I decided to write my own.  Just look for string
functions in php and you'll be fine.



-- 
Herzlich
Werner Stuerenburg            

_________________________________________________
ISIS Verlag, Teut 3, D-32683 Barntrup-Alverdissen
Tel 0(049) 5224-997 407 · Fax 0(049) 5224-997 409
http://pferdezeitung.de


Thread
MySQL and CharSetsBernhard Doebler3 Aug
  • Re: MySQL and CharSetsWerner Stuerenburg3 Aug
  • Re: MySQL and CharSetsBernhard Doebler3 Aug
  • Re: MySQL and CharSetsGrigory Bakunov4 Aug