Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] iconv, UTF -> ISO / Błąd
microh
post
Post #1





Grupa: Zarejestrowani
Postów: 102
Pomógł: 0
Dołączył: 5.11.2006

Ostrzeżenie: (10%)
X----


Witam!

Używam funkcji iconv do konwertowania łańcucha znaków do innego zestawu znaków.

Problem pojawia się gdy w łańcuchu występuje znak ’.

Powoduje on przerwanie konwertowania, a funkcja zwraca cały tekst przed podanym wyżej znakiem.

Próbowałem:

addslashes oraz : str_replace('’',' ',$string);

Bez rezultatów.

Co zrobić :/ (IMG:http://forum.php.pl/style_emoticons/default/sciana.gif) (IMG:http://forum.php.pl/style_emoticons/default/worriedsmiley.gif)

Ten post edytował microh 5.01.2008, 20:21:40
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
microh
post
Post #2





Grupa: Zarejestrowani
Postów: 102
Pomógł: 0
Dołączył: 5.11.2006

Ostrzeżenie: (10%)
X----


  1. <?php
  2. $str = " You can see shiny Cars And that's when you need me there With you I'll always share Because When the sun shines We’ll shine together Told you I'll be here forever That I'll always be your friend Took an oath Imma stick it out 'till the end Now that it's raining more than ever Know that we still have each other You can stand under 
    my Umbrella"
    ;
  3.  
  4.  
  5. $nowe = iconv('UTF-8', 'ISO-8859-2', $str);
  6.  
  7. echo $nowe;
  8. ?>


Zwraca: You can see shiny Cars And that's when you need me there With you I'll always share Because When the sun shines We

(IMG:http://forum.php.pl/style_emoticons/default/sciana.gif) (IMG:http://forum.php.pl/style_emoticons/default/sciana.gif) (IMG:http://forum.php.pl/style_emoticons/default/withstupidsmiley.gif)
Go to the top of the page
+Quote Post

Posty w temacie


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: 14.10.2025 - 10:16