Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Kodowanie tekstu, UTF-8 na ISO-8859-2
dragonik
post
Post #1





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 8.10.2004

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


mam skrypt ktorym moge czytac pliki RSS i wypisac sobie np ostatni temat z blogu tylko ze na blog.pl pliki rss zapisywane sa w kodowaniu UTF-8 a ja na mojej stronie mam kodowanie ISO-8859-2 - czy jest jakis skrypt php ktory moglby to zmienic.. albo cokolwiek co mogloby to zmienic bo krzaczki na stronie wygladaja conajmniej brzydko.

dodane po chwili: mam funkcje utf8_decode, ale zmienia ona na ISO-8859-1 a ja chce na ISO-8859-2 .. to jak? (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif)

Ten post edytował dragonik 2.12.2004, 18:03:32
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 3)
bregovic
post
Post #2





Grupa: Zarejestrowani
Postów: 562
Pomógł: 15
Dołączył: 8.08.2003
Skąd: Denmark/Odense

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


Z utf8-decode" title="Zobacz w manualu PHP" target="_manual...
  1. <?php
  2. function utf82iso88592($tekscik) {
  3.  $tekscik = str_replace(&#092;"xC4x85\", \"ą\", $tekscik);
  4.  $tekscik = str_replace(&#092;"xC4x84\", 'Ą', $tekscik);
  5.  $tekscik = str_replace(&#092;"xC4x87\", 'ć', $tekscik);
  6.  $tekscik = str_replace(&#092;"xC4x86\", 'Ć', $tekscik);
  7.  $tekscik = str_replace(&#092;"xC4x99\", 'ę', $tekscik);
  8.  $tekscik = str_replace(&#092;"xC4x98\", '', $tekscik);
  9.  $tekscik = str_replace(&#092;"xC5x82\", 'ł', $tekscik);
  10.  $tekscik = str_replace(&#092;"xC5x81\", 'Ł', $tekscik);
  11.  $tekscik = str_replace(&#092;"xC5x84\", 'ń', $tekscik);  
  12.  $tekscik = str_replace(&#092;"xC5x83\", 'Ń', $tekscik);
  13.  $tekscik = str_replace(&#092;"xC3xB3\", 'ó', $tekscik);
  14.  $tekscik = str_replace(&#092;"xC3x93\", 'Ó', $tekscik);
  15.  $tekscik = str_replace(&#092;"xC5x9B\", 'ś', $tekscik);
  16.  $tekscik = str_replace(&#092;"xC5x9A\", 'Ś', $tekscik);
  17.  $tekscik = str_replace(&#092;"xC5xBC\", 'ż', $tekscik);
  18.  $tekscik = str_replace(&#092;"xC5xBB\", 'Ż', $tekscik);
  19.  $tekscik = str_replace(&#092;"xC5xBA\", 'ź', $tekscik);
  20.  $tekscik = str_replace(&#092;"xC5xB9\", 'Ź', $tekscik);
  21.  return $tekscik;
  22. } // utf82iso88592
  23.  
  24. function iso885922utf8($tekscik) {
  25.  $tekscik = str_replace(&#092;"ą\", \"xC4x85\", $tekscik);
  26.  $tekscik = str_replace('Ą', &#092;"xC4x84\", $tekscik);
  27.  $tekscik = str_replace('ć', &#092;"xC4x87\", $tekscik);
  28.  $tekscik = str_replace('Ć', &#092;"xC4x86\", $tekscik);
  29.  $tekscik = str_replace('ę', &#092;"xC4x99\", $tekscik);
  30.  $tekscik = str_replace('', &#092;"xC4x98\", $tekscik);
  31.  $tekscik = str_replace('ł', &#092;"xC5x82\", $tekscik);
  32.  $tekscik = str_replace('Ł', &#092;"xC5x81\", $tekscik);
  33.  $tekscik = str_replace('ń', &#092;"xC5x84\", $tekscik);
  34.  $tekscik = str_replace('Ń',&#092;"xC5x83\", $tekscik);
  35.  $tekscik = str_replace('ó', &#092;"xC3xB3\", $tekscik);
  36.  $tekscik = str_replace('Ó', &#092;"xC3x93\", $tekscik);
  37.  $tekscik = str_replace('ś', &#092;"xC5x9B\", $tekscik);
  38.  $tekscik = str_replace('Ś', &#092;"xC5x9A\", $tekscik);
  39.  $tekscik = str_replace('ż', &#092;"xC5xBC\", $tekscik);
  40.  $tekscik = str_replace('Ż', &#092;"xC5xBB\", $tekscik);
  41.  $tekscik = str_replace('ź', &#092;"xC5xBA\", $tekscik);
  42.  $tekscik = str_replace('Ź', &#092;"xC5xB9\", $tekscik);  
  43.  return $tekscik;
  44. } // iso885922utf8
  45. ?>
Go to the top of the page
+Quote Post
dragonik
post
Post #3





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 8.10.2004

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


Dzieki! Podziałało (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
rachwal
post
Post #4





Grupa: Zarejestrowani
Postów: 71
Pomógł: 0
Dołączył: 29.08.2002
Skąd: Wrocław

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


Ja bym tam uzyl ICONV'a (no chyba, ze na sevie nie ma :/ ).
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: 25.08.2025 - 05:02