Novo

Forum kao aplikacija na telefonu

Dodajte forum na početni ekran i koristite ga kao aplikaciju, sa menijem na dnu ekrana.

  • 1 odgovor
  • 3.977 pregleda

Najnovija ↓

Kako da prebacim UTF8 enkoding u Windows1252 02.06.2008. u 20:57 · pre 224 meseca #1
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
Potpis
Danilo Puric
Prijavite se da biste odgovorili u ovoj temi.PrijavaRegistracija

Premeštanje teme