Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Zmiana kodowania z utf-8 na iso-8859-2, prosta sprawa, ale troche skomplikowana.
-dobryvinyl.com-
post 1.11.2004, 09:21:47
Post #1





Goście







Wszystko wydaje sie proste. Zmiana kodowania z utf-8 na iso-8859-2, ale jak to zrobic bez uzycia funkcji iconv(), ktora to na moim serverze nie dziala.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 14)
bregovic
post 1.11.2004, 09:40:01
Post #2





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

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


Bez iconv lub mb nie uda ci się AFAIK przekonwertować kodowania dokumentów.


--------------------
Prank - for the fun. Mac - for the simplicity. Deviantart - for the kick.
Life is ours, We live it our way -- Metallica
Go to the top of the page
+Quote Post
-dobryvinyl.com-
post 1.11.2004, 09:48:34
Post #3





Goście







a jak by to wygladalo przy pomocy mb> jesli mozna spytac ?
Go to the top of the page
+Quote Post
bregovic
post 1.11.2004, 09:59:35
Post #4





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

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


Nie mam pojęcia - możesz się doczytać, tutaj winksmiley.jpg

Ten post edytował bregovic 1.11.2004, 09:59:45


--------------------
Prank - for the fun. Mac - for the simplicity. Deviantart - for the kick.
Life is ours, We live it our way -- Metallica
Go to the top of the page
+Quote Post
-Guest-
post 1.11.2004, 10:15:48
Post #5





Goście







kolejna funkcja ktora na moim serverze nie dziala.
Go to the top of the page
+Quote Post
MoD
post 1.11.2004, 18:00:21
Post #6





Grupa: Zarejestrowani
Postów: 193
Pomógł: 0
Dołączył: 14.09.2003
Skąd: Brodnica (koło Torunia)

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


To zmień server biggrin.gif


--------------------
Go to the top of the page
+Quote Post
dobryvinyl.com
post 1.11.2004, 22:26:44
Post #7





Grupa: Zarejestrowani
Postów: 126
Pomógł: 0
Dołączył: 1.11.2004

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


tak server, imie, nazwisko, miejsce zamieszkania i najlepiejj jeszcze plec...


--------------------
___________________________________________
www.digart.pl / galeria jakich mało.
Go to the top of the page
+Quote Post
Paul
post 1.11.2004, 22:38:22
Post #8





Grupa: Zarejestrowani
Postów: 636
Pomógł: 0
Dołączył: 22.10.2003
Skąd: Katowice

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


Zobacz tutaj - nizej w komentarzach sa takie funkcje
Go to the top of the page
+Quote Post
hwao
post 2.11.2004, 08:23:17
Post #9


Developer


Grupa: Moderatorzy
Postów: 2 844
Pomógł: 20
Dołączył: 25.11.2003
Skąd: Olkusz




zawsze mozesz
$strBuffor = ob_start();

i na konuc pozamianiac wszystko chocby str_replace();
Go to the top of the page
+Quote Post
scanner
post 2.11.2004, 12:11:05
Post #10





Grupa: Zarząd
Postów: 3 503
Pomógł: 28
Dołączył: 17.10.2002
Skąd: Wrocław




A tak w kwestii formalnej, czemu przeszkadza Ci UTF-8 ?


--------------------
scanner.info
Warto pamiętać: KISS, DRY
Go to the top of the page
+Quote Post
dobryvinyl.com
post 2.11.2004, 18:40:21
Post #11





Grupa: Zarejestrowani
Postów: 126
Pomógł: 0
Dołączył: 1.11.2004

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


scanner, pobieram wyniki a konkretnie pracuje www w UTF-8 i publikuje to na stronie w iso.


--------------------
___________________________________________
www.digart.pl / galeria jakich mało.
Go to the top of the page
+Quote Post
-Gość_Prometeus-
post 2.11.2004, 19:44:15
Post #12





Goście







Prosze bardzo:

  1. <?php
  2. function utf82iso88592($tekscik) {
  3.  $tekscik = str_replace(&#092;"xC4x85\", \"&plusmn;\", $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;"xC3xB3\", 'ó', $tekscik);
  12.  $tekscik = str_replace(&#092;"xC3x93\", 'Ó', $tekscik);
  13.  $tekscik = str_replace(&#092;"xC5x9B\", '&para;', $tekscik);
  14.  $tekscik = str_replace(&#092;"xC5x9A\", '&brvbar;', $tekscik);
  15.  $tekscik = str_replace(&#092;"xC5xBC\", 'Ľ', $tekscik);
  16.  $tekscik = str_replace(&#092;"xC5xBB\", '&not;', $tekscik);
  17.  $tekscik = str_replace(&#092;"xC5xBA\", 'ż', $tekscik);
  18.  $tekscik = str_replace(&#092;"xC5xB9\", 'Ż', $tekscik);
  19.  $tekscik = str_replace(&#092;"xC5x83\", 'Ń', $tekscik);
  20.  $tekscik = str_replace(&#092;"xC5x84\", 'ń', $tekscik);
  21.  return $tekscik;
  22. }
  23.  
  24. oraz :
  25.  
  26. function iso885922utf8($tekscik) {
  27.  $tekscik = str_replace(&#092;"&plusmn;\", \"xC4x85\", $tekscik);
  28.  $tekscik = str_replace( 'ˇ', &#092;"xC4x84\", $tekscik);
  29.  $tekscik = str_replace('ć', &#092;"xC4x87\" $tekscik);
  30.  $tekscik = str_replace('Ć', &#092;"xC4x86\". $tekscik);
  31.  $tekscik = str_replace( 'ę', &#092;"xC4x99\", $tekscik);
  32.  $tekscik = str_replace( '', &#092;"xC4x98\",$tekscik);
  33.  $tekscik = str_replace( 'ł', &#092;"xC5x82\",$tekscik);
  34.  $tekscik = str_replace( 'Ł', &#092;"xC5x81\",$tekscik);
  35.  $tekscik = str_replace('ó', &#092;"xC3xB3\", $tekscik);
  36.  $tekscik = str_replace( 'Ó', &#092;"xC3x93\",$tekscik);
  37.  $tekscik = str_replace( '&para;', &#092;"xC5x9B\",$tekscik);
  38.  $tekscik = str_replace('&brvbar;', &#092;"xC5x9A\", $tekscik);
  39.  $tekscik = str_replace('Ľ', &#092;"xC5xBC\", $tekscik);
  40.  $tekscik = str_replace('&not;', &#092;"xC5xBB\", $tekscik);
  41.  $tekscik = str_replace('ż', &#092;"xC5xBA\", $tekscik);
  42.  $tekscik = str_replace('Ż', &#092;"xC5xB9\", $tekscik);
  43.  $tekscik = str_replace('Ń', &#092;"xC5x83\", $tekscik);
  44.  $tekscik = str_replace('ń', &#092;"xC5x84\", $tekscik);
  45.  return $tekscik;
  46. }
  47.  
  48. ?>


funkcje działają na pewno - a jak jakieś problemy to ręcznie popraw

a tak swoją drogą to w dokuemntacji warto takze czytać komentarze bo tam często Polacy piszą jak rozwiązać różne ciekawe problemy...

ehh, lamerstwo i obiboctwo się szerzy winksmiley.jpg - żartuję

nm: czy któryś z adminów, modków może mi pomóc odzyskać moje haśło questionmark.gif funkcja odzyskwiania cos fiksuje sad.gif


----
Prosze uzywac [php] do umieszcznia kodu php
hwao
Go to the top of the page
+Quote Post
-Guest-
post 2.11.2004, 19:45:11
Post #13





Goście







To znowu ja...ten co wyżej...

Niestety forum wycięło część znaków i przerobiło je na głupotki - będziesz musiał ręcznie je podobierać ale to jest tylko około 5 minut pracy...
Go to the top of the page
+Quote Post
rogrog
post 2.11.2004, 20:39:54
Post #14





Grupa: Zarejestrowani
Postów: 602
Pomógł: 1
Dołączył: 3.04.2004
Skąd: Trójmiasto (Gdańsk)

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


Prometeus: okropnie dużo razy wywołujesz str_replace - można odpowiedniki wrzucić do dwóch tablic i podmienić tylko jednym wywołaniem str_replace co na pewno będzie miało duży wpływ na wydajność smile.gif pozytywny oczywiscie tongue.gif


--------------------
Go to the top of the page
+Quote Post
Kocurro
post 2.11.2004, 21:45:24
Post #15





Grupa: Zarejestrowani
Postów: 461
Pomógł: 32
Dołączył: 17.09.2003
Skąd: Łódź

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


Ja wkleiłem kod, który kiedyś ze strony php.net dorwałem smile.gif

Nigdy nie wklejam kodów, które optymizowałem - po prostu nikt by się nie rozczytał smile.gif

rogrog - jak najbardziej masz rację, w moich pracach wykorzysuję odpowiednie tablice, jedno wywołanie str_replace na samym początku i działą naprawdę dobrze smile.gif

pozdrawiam
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 8.07.2025 - 05:16