CSV fgetcsv() import removes special chars link â
CSV fgetcsv() import removes special chars link â
am 23.04.2008 13:55:57 von matech
how can I import CSV/TXT files without PHP removing special
characters?
I need to import CSV files to Mysql with lots of different characters.
for example: the original data is "SA-=E2-Gal Staining" and the import
data is: "SA-²-Gal Staining"
another example: "50 =ECL "
converted to: "50 1/4=03g"
Thanks.
Re: CSV fgetcsv() import removes special chars linkâ
am 23.04.2008 15:36:08 von hellsop
On Wed, 23 Apr 2008 04:55:57 -0700 (PDT), matech wrote:
> how can I import CSV/TXT files without PHP removing special
> characters?
> I need to import CSV files to Mysql with lots of different characters.
>
> for example: the original data is "SA-â-Gal Staining" and the import
> data is: "SA-²-Gal Staining"
>
> another example: "50 ìL "
> converted to: "50 1/4g"
First, discover what encoding the csv file is in.
--
97. My dungeon cells will not be furnished with objects that contain reflective
surfaces or anything that can be unravelled.
--Peter Anspach's list of things to do as an Evil Overlord
Re: CSV fgetcsv() import removes special chars link
am 24.04.2008 11:03:43 von matech
On 23 Apr, 14:36, "Peter H. Coffin" wrote:
> On Wed, 23 Apr 2008 04:55:57 -0700 (PDT), matech wrote:
> > how can I import CSV/TXT files without PHP removing special
> > characters?
> > I need to import CSV files to Mysql with lots of different characters.
>
> > for example: the original data is "SA-=E2-Gal Staining" and the import
> > data is: "SA-=B2 -Gal Staining"
>
> > another example: "50 =ECL "
> > converted to: "50 1/4 g"
>
> First, discover what encoding the csv file is in.
>
> --
> 97. My dungeon cells will not be furnished with objects that contain refle=
ctive
> =A0 =A0 surfaces or anything that can be unravelled.
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 --Peter Anspach's list of things to do as =
an Evil Overlord
the file is saved as unicode (UTF-8) CSV
Re: CSV fgetcsv() import removes special chars link â
am 24.04.2008 11:07:52 von luiheidsgoeroe
On Thu, 24 Apr 2008 11:03:43 +0200, matech
wrote:
> On 23 Apr, 14:36, "Peter H. Coffin" wrote:
>> On Wed, 23 Apr 2008 04:55:57 -0700 (PDT), matech wrote:
>> > how can I import CSV/TXT files without PHP removing special
>> > characters?
>> > I need to import CSV files to Mysql with lots of different characters.
>>
>> > for example: the original data is "SA-â-Gal Staining" and the import
>> > data is: "SA-² -Gal Staining"
>>
>> > another example: "50 ìL "
>> > converted to: "50 1/4 g"
>>
>> First, discover what encoding the csv file is in.
>>
>
> the file is saved as unicode (UTF-8) CSV
And how do you check your output? If by HTML/browser, do you send it a
header("Content-Type: text/plain; charset=utf-8") ? (or text/html, or is
the webserver or PHP (set dafault_mimetype & default_charset) configured
to do so?)
--
Rik Wasmus
Re: CSV fgetcsv() import removes special chars link
am 24.04.2008 13:27:17 von matech
On Apr 24, 10:07Â am, "Rik Wasmus" wrote:
> On Thu, 24 Apr 2008 11:03:43 +0200, matech =
Â
> wrote:
>
>
>
>
>
> > On 23 Apr, 14:36, "Peter H. Coffin" wrote:
> >> On Wed, 23 Apr 2008 04:55:57 -0700 (PDT), matech wrote:
> >> > how can I import CSV/TXT files without PHP removing special
> >> > characters?
> >> > I need to import CSV files to Mysql with lots of different characters=
..
>
> >> > for example: the original data is "SA-â-Gal Staining" and the im=
port
> >> > data is: "SA-² -Gal Staining"
>
> >> > another example: "50 ìL "
> >> > converted to: "50 1/4 g"
>
> >> First, discover what encoding the csv file is in.
>
> > the file is saved as unicode (UTF-8) CSV
>
> And how do you check your output? If by HTML/browser, do you send it a =C2=
=A0
> header("Content-Type: text/plain; charset=3Dutf-8") ? (or text/html, or is=
Â
> the webserver or PHP (set dafault_mimetype & default_charset) configured =
Â
> to do so?)
> --
> Rik Wasmus- Hide quoted text -
>
> - Show quoted text -
thanks Rik.
I set the webserver default_mimetype and it worked. (the result: "SA-β-=
Gal Staining")