Jump to content
Taz

what encoding needed in SQL table for correct Russian symbols?

Recommended Posts

What encoding need in table "vending" for correct Russian simbols? character name and vending name look as "����"

 

Какую кодировку нужно ставить для созданной таблицы? все русские имена выглядят как вопросительные знаки

Link to comment
Share on other sites

Можно утф-8, если не поможет попробуй cp1251

 

CREATE TABLE `vending` (
  `char_id` int(11) unsigned NOT NULL DEFAULT '0',
  `name` varchar(50) DEFAULT NULL,
  `index` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `nameid` int(11) unsigned NOT NULL DEFAULT '0',
  `amount` int(11) unsigned NOT NULL DEFAULT '0',
  `price` bigint(20) unsigned NOT NULL DEFAULT '0',
  `refine` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `card0` smallint(11) NOT NULL DEFAULT '0',
  `card1` smallint(11) NOT NULL DEFAULT '0',
  `card2` smallint(11) NOT NULL DEFAULT '0',
  `card3` smallint(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`char_id`,`index`),
  KEY `char_id` (`char_id`),
  KEY `nameid` (`nameid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
Link to comment
Share on other sites

Попробовал и так, и так. Причем таблицу полностью удалял и создавал новую. В самой базе отображается нормально, а вывод хромает. Проблема аналогичная и в раскореженном мной моде на fluxcp, так и в нетронутой отдельной версии.

Link to comment
Share on other sites

В конфиг

после

$db = new db("mysql:host={$host};dbname={$dbname}", $user, $pass);  
$db->setErrorCallbackFunction("print_r", "text"); 

добавь

$db->run("set names utf8");

и таблицу в utf-8 оставь.

 

Вот здесь так и работает http://ragnaok.net/vending_database/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.