Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Kako da prebacim UTF8 enkoding u Windows1252

[es] :: Web razvoj :: Kako da prebacim UTF8 enkoding u Windows1252

[ Pregleda: 3026 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

studio-bild
Danilo Puric
ALL IN ONE :)
Podgorica

Član broj: 181538
Poruke: 1
77.222.8.*

Sajt: www.bild-studio.com


Profil

icon Kako da prebacim UTF8 enkoding u Windows125202.06.2008. u 19:57 - pre 193 meseci
Kupim tekst sa rss stranice http://www.cafemontenegro.com/rss/?group=22 koji se nalazi u UTF8 enkodingu. Treba da ga prebacim u windows-1252 encoding.

Jedan nacin je da stavim ovaj kod u <head> stranice <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

ali meni on ne odgovara jer mi je ceo sajt u windows-1252.

PItanje je da li postoji neka finkcija u PHP-u koja bi prebacila utf8 u windows-1252. Nasao sam jednu funkciju ali ne radi bas najbolje(nece da cita neka slova kao sto je č, ć ... )

function utf2windows1250 ($text) {
$text = str_replace("Ä„", '&#260;', $text); //Ą
$text = str_replace("Ć", '&#262;', $text); //Ć
$text = str_replace("Ę", '&#280;', $text); //Ę
$text = str_replace("Ł", '&#321;', $text); //Ł
$text = str_replace("Ń", '&#323;', $text); //Ń
$text = str_replace("Ó", '&#211;', $text); //Ó
$text = str_replace("Åš", '&#346;', $text); //Ś
$text = str_replace("Ź", '&#377;', $text); //Ź
$text = str_replace("Å»", '&#379;', $text); //Ż
$text = str_replace("Ä…", '&#261;', $text); //ą
$text = str_replace("ć", '&#263;', $text); //ć
$text = str_replace("Ä™", '&#281;', $text); //ę
$text = str_replace("Å‚", '&#322;', $text); //ł
$text = str_replace("Å„", '&#324;', $text); //ń
$text = str_replace("ó", '&#243;', $text); //ó
$text = str_replace("Å›", '&#347;', $text); //ś
$text = str_replace("ź", '&#378;', $text); //ź
$text = str_replace("š", '&#380;', $text); //ż

return $text;
}

LJUDI BAS ME OVO IZNERVIRALO POMAGAJTE
Danilo Puric
 
Odgovor na temu

bzero
dev null
europe

Član broj: 5907
Poruke: 371
*.revip2.asianet.co.th.

Jabber: bzero@elitesecurity.org
Sajt: www.google.com/search?q=b..


Profil

icon Re: Kako da prebacim UTF8 enkoding u Windows125203.06.2008. u 02:32 - pre 193 meseci
http://www.php.net/manual/en/function.iconv.php

Code:

$win_1252 = iconv('UTF-8', 'windows-1252', $text);




Never trust an operating system you don't have sources for.
 
Odgovor na temu

[es] :: Web razvoj :: Kako da prebacim UTF8 enkoding u Windows1252

[ Pregleda: 3026 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.