|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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" Thanks. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On 23 Apr, 14:36, "Peter H. Coffin" <hell...@ninehells.com> 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. > > -- > 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 the file is saved as unicode (UTF-8) CSV |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On Thu, 24 Apr 2008 11:03:43 +0200, matech <robert.mateer@hotmail.co.uk>
wrote: > On 23 Apr, 14:36, "Peter H. Coffin" <hell...@ninehells.com> 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 |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
On Apr 24, 10:07Âam, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
> On Thu, 24 Apr 2008 11:03:43 +0200, matech <robert.mat...@hotmail.co.uk>  > wrote: > > > > > > > On 23 Apr, 14:36, "Peter H. Coffin" <hell...@ninehells.com> 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- Hide quoted text - > > - Show quoted text - thanks Rik. I set the webserver default_mimetype and it worked. (the result: "SA-β- Gal Staining") |
|
![]() |
| Outils de la discussion | |
|
|