Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP] Jak importowac CSV z polskimi nakami Windows UTF8?
tomas3man
post
Post #1





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 22.09.2014

Ostrzeżenie: (0%)
-----


Pytanie trywialne....

fread, fgetcsv, getchar, League/CSV -- sobie z tym nie radza, jezeli plik ma polski znak, zwraca null.


Go to the top of the page
+Quote Post
trueblue
post
Post #2





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

Ostrzeżenie: (0%)
-----


Ustawiałeś locale przed importem?
Go to the top of the page
+Quote Post
tomas3man
post
Post #3





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 22.09.2014

Ostrzeżenie: (0%)
-----


Cytat(trueblue @ 5.11.2014, 17:10:30 ) *
Ustawiałeś locale przed importem?

Wlasnie ustawilem..... (IMG:style_emoticons/default/sad.gif)

cat /etc/default/locale
# File generated by update-locale
LANG=pl_PL.UTF-8
Go to the top of the page
+Quote Post
trueblue
post
Post #4





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

Ostrzeżenie: (0%)
-----


A niezależnie od tego co zrobiłeś, w samym kodzie:
Kod
setlocale(LC_ALL,"pl_PL.UTF-8");

?

Ten post edytował trueblue 5.11.2014, 18:35:30
Go to the top of the page
+Quote Post
tomas3man
post
Post #5





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 22.09.2014

Ostrzeżenie: (0%)
-----


Cytat(trueblue @ 5.11.2014, 18:34:56 ) *
A niezależnie od tego co zrobiłeś, w samym kodzie:
Kod
setlocale(LC_ALL,"pl_PL.UTF-8");

?


  1. setlocale(LC_ALL,"pl_PL.UTF-8");
  2. $csv = Reader::createFromPath($filename);
  3. $headers = $csv->fetchOne();
  4. echo debug($headers);


Dodalem do systemu :
  1. cat /etc/rc.local
  2. #!/bin/sh -e
  3.  
  4. LC_ALL="pl_PL.UTF-8"
  5. export LC_ALL
  6.  
  7. LANG="pl_PL.UTF-8"
  8. export LANG
  9.  


Dalej nie dziala? Koncza mi sie pomysly...

Ten post edytował tomas3man 5.11.2014, 21:01:48
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 13:03