![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 17 Pomógł: 0 Dołączył: 1.08.2007 Ostrzeżenie: (0%) ![]() ![]() |
witam!
Potrzebuję jakiegoś kodu w php za pomocą którego funkcja fwrite() zapisze w pliku .txt ciąg znaków w kodowaniu UTF-8. |
|
|
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 53 Pomógł: 0 Dołączył: 31.03.2006 Ostrzeżenie: (0%) ![]() ![]() |
Może trzeba wykorzystać funkcję utf8_encode" title="Zobacz w manualu PHP" target="_manual, żeby zakodować treść, którą następnie zapiszesz do pliku.
![]() Cytat(cutmaster at fearlesss dot com) For those who, like me, lost a lot of minutes (hours) to understand why fwrite doesn't create a real utf-8 file, here's the explanation I've found :
I tried to do something like this :
For a mysterious reason, the resulted file shows the accent without the utf-8 conversion. I tried the binary, mode, etc. etc. And finally I've found it : It seems that fwrite NEEDS to have the utf8_encode function INSIDE its parameters like this, to understand it must create a non-text only file :
Hope this will help Ten post edytował pojas 1.08.2007, 10:51:28 |
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 17 Pomógł: 0 Dołączył: 1.08.2007 Ostrzeżenie: (0%) ![]() ![]() |
Wielkie dzięki, o to mi chodziło
![]() |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 27.05.2025 - 21:28 |