Jak zauważyłem w najnowszych plikach sfgame
brakuje paru linijek które są potrzebne by
polskie znaki działały w opisach itp.
Postanowiłem więc udostęnić moje linijki kodu:
Instrukcja:
Zmieniamy w pliku req.php
całą funkcje "fixSpecialChars"
na to :
Spoiler
function fixSpecialChars($text)
{
$text = str_replace('ł', 'ł', $text);
$text = str_replace('Ł', 'Ł', $text);
$text = str_replace('ą', 'ą', $text);
$text = str_replace('Ą', 'Ą', $text);
$text = str_replace('ę', 'ę', $text);
$text = str_replace('Ę', 'Ę', $text);
$text = str_replace('ć', 'ć', $text);
$text = str_replace('Ć', 'Ć', $text);
$text = str_replace('ś', 'ś', $text);
$text = str_replace('Ś', 'Ś', $text);
$text = str_replace('ż', 'ż', $text);
$text = str_replace('Ż', 'Ż', $text);
$text = str_replace('ź', 'ź', $text);
$text = str_replace('Ź', 'Ź', $text);
$text = str_replace('%40', '@', $text);
return $text;
}
{
$text = str_replace('ł', 'ł', $text);
$text = str_replace('Ł', 'Ł', $text);
$text = str_replace('ą', 'ą', $text);
$text = str_replace('Ą', 'Ą', $text);
$text = str_replace('ę', 'ę', $text);
$text = str_replace('Ę', 'Ę', $text);
$text = str_replace('ć', 'ć', $text);
$text = str_replace('Ć', 'Ć', $text);
$text = str_replace('ś', 'ś', $text);
$text = str_replace('Ś', 'Ś', $text);
$text = str_replace('ż', 'ż', $text);
$text = str_replace('Ż', 'Ż', $text);
$text = str_replace('ź', 'ź', $text);
$text = str_replace('Ź', 'Ź', $text);
$text = str_replace('%40', '@', $text);
return $text;
}
Ewentualnie jeśli kożystamy z
innych plików:
1.Szukamy takich linijek:
$ret[511] .= ";" . urldecode($db_data['user_desc']) . ";";
2. Zmieniamy powyższy kod na :
$ret[511] .= ";" . fixSpecialChars(urldecode($db_data['user_desc'])) . ";";
3. Dodajemy funkcje :
Spoiler
function fixSpecialChars($text)
{
$text = str_replace('ł', 'ł', $text);
$text = str_replace('Ł', 'Ł', $text);
$text = str_replace('ą', 'ą', $text);
$text = str_replace('Ą', 'Ą', $text);
$text = str_replace('ę', 'ę', $text);
$text = str_replace('Ę', 'Ę', $text);
$text = str_replace('ć', 'ć', $text);
$text = str_replace('Ć', 'Ć', $text);
$text = str_replace('ś', 'ś', $text);
$text = str_replace('Ś', 'Ś', $text);
$text = str_replace('ż', 'ż', $text);
$text = str_replace('Ż', 'Ż', $text);
$text = str_replace('ź', 'ź', $text);
$text = str_replace('Ź', 'Ź', $text);
$text = str_replace('%40', '@', $text);
return $text;
}
{
$text = str_replace('ł', 'ł', $text);
$text = str_replace('Ł', 'Ł', $text);
$text = str_replace('ą', 'ą', $text);
$text = str_replace('Ą', 'Ą', $text);
$text = str_replace('ę', 'ę', $text);
$text = str_replace('Ę', 'Ę', $text);
$text = str_replace('ć', 'ć', $text);
$text = str_replace('Ć', 'Ć', $text);
$text = str_replace('ś', 'ś', $text);
$text = str_replace('Ś', 'Ś', $text);
$text = str_replace('ż', 'ż', $text);
$text = str_replace('Ż', 'Ż', $text);
$text = str_replace('ź', 'ź', $text);
$text = str_replace('Ź', 'Ź', $text);
$text = str_replace('%40', '@', $text);
return $text;
}
Brak komentarzy:
Prześlij komentarz