Kodları lütfen aşağıdaki butonları kullanarak renklendirin. Örnek: <php> echo "Selam Dünya"; </php>
Yardım
karakter kaldı

Türkçe Karakter Sorunu (Sadece küçük ı ve ş harfi :)

Aşağıda verdiğim php dosyasında dil kodlaması var. fakat windows-1234'te olsa utf-8 de olsa küçük ı harfi &#305; böyle çıkıyor, ayrıca ş harfide &#351; çıkıyor:(


<?php
$charset = 'windows-1254';
header("Content-type: text/html; charset=".$charset);

## ADDED / REDEFINED FOR 1.5.2
define('_button_title_del_account' , 'User-Account delete');
define('_confirm_del_account' , 'You really want to delete your Account on dzcp.de');
define('_profil_del_account' , 'Account delete');
define('_info_account_deletet' , 'Your Account has been successfully deleted!');
define('_profil_del_admin' , '<b>Deleting not possible!</b>');
define('_news_get_timeshift' , "Timeshift News?");
define('_news_timeshift_from', 'Show news from:');
define('_config_gb_activ' , 'Guestbook');
define('_config_gb_activ_info' , '<center>Here you can specify whether an item will only be released by an admin must.</center>');
define('_legend_map_download' , 'Download map screenshots from dzcp.de');
define('_map_download_success' , 'The screenshots has been successfully downloaded and saved!');
define('_mapdl_download' , 'Should I search and download map screenshots for this server?');
define('_error_mapdl_nomap' , 'For this game, no map screenshot is available right now.<br />If you want to share maps for this game with the community, please mail them to <a href="mailto:webmaster@dzcp.de.">webmaster@dzcp.de.</a>');
define('_error_mapdl_connection' , 'No connection to the gameserver could be established.');
define('_error_mapdl_server' , 'This gameserver does not exist!');
define('_mapdl_loading' , 'Loading maps from dzcp.de');
define('_placeholder' , 'Template Placeholder');
define('_menu_kats_head' , 'Menu Categories');
define('_menu_add_kat' , 'Add new menu category');
define('_confirm_del_menu' , 'Dyo you really want to delet the menu category?');
define('_menu_edit_kat' , 'Edit menu category');
define('_menukat_updated' , 'The menu category has been successfully edited!');
define('_menukat_inserted' , 'The menu category has been successfully added!');
define('_menukat_deleted' , 'The menu category has been successfully deleted!');
define('_menu_visible' , 'visible for status');
define('_menu_kat_info' , 'The css classes for the link will be constructed from the template placeholder, automatically.<br />e.g. for the placeholder <i>[nav_main]</i>, the css class will be <i>a.navMain</i>');
define('_admin_sqauds_roster' , 'Team-Roster');
define('_admin_squads_nav_info' , 'This will put a direct link in the navigation, which target to full size of the Team.');
define('_admin_squads_teams' , 'Team-Show');
define('_admin_squads_no_navi' , 'Don\'t show');
define('_seconds' , 'Seconds');
define('_config_cache_info' , 'here you can set intervals, when teamspeak and gamserver will be reloaded. Outherwise the informations will be read from the cache.');
define('_config_direct_refresh' , 'Direct Forward');
define('_config_direct_refresh_info' , 'If activated, the site will be forwarded directly, instead of showing the status information.');
define('_cw_reset_button' , 'Admin: Reset player status');
define('_cw_players_reset' , 'The player status has been successfully reseted!');
define('_eintrag_titel_forum' , '<a href="[url]" title="Show this post"><span class="fontBold">#[postid]</span></a> at [datum] on [zeit]  [edit] [delete]');
define('_eintrag_titel' , '<span class="fontBold">#[postid]</span> at [datum] on [zeit]  [edit] [delete]');
## ADDED / REDEFINED FOR 1.5.1
define('_config_double_post' , 'Forum double post');
define('_config_fotum_vote' , 'Forum-Vote');
define('_config_fotum_vote_info' , '<center>Here you can specify whether a Forum-Vote also Vote to be displayed.</center>');
## ADDED / REDEFINED FOR 1.5
define('_installdir' , "<tr><td colspan=\"15\" class=\"contentMainFirst\"><br /><center>In case of security reasons, please remove the folder \"<b>/_installer</b>\" from your webserver! Only then the admin menu available!</center><br /></td></tr>");
define('_no_ts' , 'no Teamspeak');
define('_search_sites' , 'Sites');
define('_search_results' , 'Search Results');
define('_config_useradd_head' , 'Add User');
define('_config_adduser' , 'Add User');
define('_uderadd_info' , 'The User has been successfully added');
define('_useradd_head' , 'Add new User');
define('_useradd_about' , 'Userdetails');
define('_login_signup' , 'Register');
define('_login_lostpwd' , 'Password?');
define('_config_links' , 'Links');
define('_no_server_navi' , 'no server registered');
define('_vote_menu_no_vote' , 'no vote registered');
define('_no_top_match' , 'no top match registered!');
define('_team_logo' , 'Team Logo');
define('_cw_logo' , 'Opponent Logo');
define('_cw_screenshot' , 'Screenshot');
define('_cw_admin_top_setted' , 'This Clanwar has been successfully added as top match!');
define('_cw_admin_top_unsetted' , 'This Clanwar has been successfully removed as top match!');
define('_cw_admin_top_set' , 'Add es top match');
define('_cw_admin_top_unset' , 'Remove as top match');
define('_sq_banner' , 'Teambanner');
define('_forum_abo_title' , 'Suscribe Thread');
define('_forum_vote' , 'Vote');
define('_admin_user_clanhead_info' , 'These permissions can be set <u>additional</u> to the permissions in the user ranks.');
define('_user_noposi' , '<option value="lazy" class="dropdownKat">no user rank</option>');
define('_config_positions_boardrights' , 'internal board permissions');
define('_perm_awards' , 'manage awards');
define('_perm_clankasse' , 'manage Clancash');
define('_perm_contact' , 'receive contact form');
define('_perm_editkalender' , 'manage calendar entries');
define('_perm_editserver' , 'manage server');
define('_perm_edittactics' , 'manage tactics');
define('_perm_forum' , 'board admin');
define('_perm_gb' , 'guestbook admin');
define('_perm_links' , 'manage links');
define('_perm_newsletter' , 'manage newsletter');
define('_perm_rankings' , 'manage rankings');
define('_perm_serverliste' , 'manage serverlist');
define('_perm_votesadmin' , 'manage votes');
define('_perm_artikel' , 'manage articles');
define('_perm_clanwars' , 'manage clanwars');
define('_perm_downloads' , 'manage dowloads');
define('_perm_editor' , 'manage sites');
define('_perm_editsquads' , 'manage teams');
define('_perm_editusers' , 'can edit users');
define('_perm_gallery' , 'manage galleries');
define('_perm_glossar' , 'manage glossar');
define('_perm_intnews' , 'can read internal news');
define('_perm_joinus' , 'receive joinus form');
define('_perm_news' , 'manage news');
define('_perm_shoutbox' , 'Shoutbox admin');
define('_perm_votes' , 'can see internal votes');
define('_config_positions_rights' , 'Permissions');
define('_config_positions' , 'User Ranks');
define('_admin_pos' , 'User Ranks');
define('_awaycal' , 'Away Calendar');
define('_clear_away' , 'Away Calendar entrys?');
define('_config_sponsors' , 'Sponsors');
define('_sponsors_admin_head' , 'Sponsors');
define('_sponsors_admin_add' , 'Add Sponsor');
define('_sponsor_added' , 'The sponsor has been successfully registered!');
define('_sponsor_edited' , 'The sponsor has been successfully edited!');
define('_sponsor_deleted' , 'The sponsor has been successfully deleted!');
define('_sponsor_name' , 'Sponsorname');
define('_sponsors_admin_name' , 'Name');
define('_sponsors_admin_site' , 'Sponsor site');
define('_sponsors_admin_addsite' , 'To sponsorsite');
define('_sponsors_admin_add_site' , 'This

banner will be displayed at the
+0
-0
Cevaba KatılıyorumKatılmıyorum
Cevap Yaz Yorum Yaz Arşivime Ekle Takip Et

Cevaplar

  • GhostDeveloper adlı üyenin fotoğrafı
    11 yıl önce yazılmış
    2 cevap - 3 soru
    Türkçe karakter problemi için kullandığım bilgiyi paylaşayım.
    ...
    $mesaj = $_POST['mesaj'];
    $tr = array('Ç', 'ç', 'Ğ', 'ğ', 'ı', 'İ', 'Ö', 'ö', 'Ş', 'ş', 'Ü', 'ü');
    $kod = array('& Ccedil;', '& ccedil;', '& #286;', '& #287;', '& #305;', '& #304;', '& Ouml;', '& ouml;', '& #350;', '& #351;', '& Uuml;', '& uuml;');
    $veri = str_replace($tr, $kod, $mesaj);
    ...

    &'den sonraki boşlukları silmeniz gerek.
    Böylece formdan gelen $mesaj değişkeni Türkçe karakterlerinin yerini kodlara bırakarak $veri değişkenine dönüşüyor.

    ya da

    Veriyi gönderirken url_encede(); aldıktan sonrada url_decode(); yapın.

    ya da

    Tam istediğiniz gibi geliştirilmiş hazır bir fonksiyon var zaten: htmlentities()
    Sonra tekrar eski haline çevirmek için: html_entity_decode()
    • olcay adlı üyenin fotoğrafı olcay
      $mesaj = $_POST['mesaj']; 
       $tr = array('Ç', 'ç', 'Ğ', 'ğ', 'ı', 'İ', 'Ö', 'ö', 'Ş', 'ş', 'Ü', 'ü'); 
       $kod = array('& Ccedil;', '& ccedil;', '& #286;', '& #287;', '& #305;', '& #304;', '& Ouml;', '& ouml;', '& #350;', '& #351;', '& Uuml;', '& uuml;'); 
       $veri = str_replace($tr, $kod, $mesaj);
      


      birde alırken ... verirken .... yapın demişsiniz. Benim pek fazla php bilgim yok. Yukarıda verdiğiniz kodu nereye eklemeliyim?
      11 yıl önce yazılmış
    • GhostDeveloper adlı üyenin fotoğrafı GhostDeveloper
      Problemin olduğu metni $mesaj'a ata. Ben $_POST['mesaj']; demişim onun yerine. $tr ve $kod'a dokunma, $veri değişkeni senin Türkçe karakter problemi giderilmiş metnin olarak. Tabii $kod dizisi içindeki &ler ile kendinden sonra gelen karakterlerin arasındaki boşluğu kapatmayı unutma. Ben burda o karakterler birleşince Ç ç Ğ ğ olacağı için ayrı verdim sana.

      Bazen de bir sayfadan bir sayfaya get ile metin gönderilir. Buralarda da Türkçe karakter problemi olabiliyor. Veriyi bir sayfaya gönderme, bir sayfadan alma diye bu yüzden bilgi verdim.
      11 yıl önce yazılmış
  • sagoral adlı üyenin fotoğrafı
    11 yıl önce yazılmış
    38 cevap - 2 soru
    windows-1254 yerine UTF-8'i denesiniz header için
    • olcay adlı üyenin fotoğrafı olcay
      denedim, yine olmuyo. Ayrıca şunuda belirtim. Bu ı ve ş harfi sadece forumda konu başlığında böyle gözüküyor!
      11 yıl önce yazılmış
    • sagoral adlı üyenin fotoğrafı sagoral
      Sütun karakteri ne olarak ayarlı?
      11 yıl önce yazılmış
    • olcay adlı üyenin fotoğrafı olcay
      sütun karakterleri derken?
      11 yıl önce yazılmış
    • sagoral adlı üyenin fotoğrafı sagoral
      Veritabanında ilgili tablonun karakter seti ve ilgili sütunun karakter seti ne olarak ayarlı?
      11 yıl önce yazılmış
    • olcay adlı üyenin fotoğrafı olcay
      utf-8_turkish_ci... birde şunu farkettim. Bu çıkan karakterleri veritabanında konu ismini düzenliyorum. Bu işaretler kayboluyor ve ? işareti çıkıyor. Veritabanında ayarlıyorumda. Neden forumda böyle oluyor? galiba veritabanında sorun..
      11 yıl önce yazılmış
    • sagoral adlı üyenin fotoğrafı sagoral
      Şu konuyu inceler misin http://togl.me/a5B
      11 yıl önce yazılmış
    • olcay adlı üyenin fotoğrafı olcay
      bi işe yaramadı.
      11 yıl önce yazılmış