1
我在任何地方都有UTF-8,爲什麼Page.last.url.encoding返回「ASCII-8BIT」?即使指定了UTF8,Ruby 1.9字段也會返回ASCII編碼
我的database.yml:
development:
adapter: mysql
username: root
encoding: utf8
database: recipebook
的mysql:
CREATE TABLE `pages` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`user_id` int(11) DEFAULT NULL,
`recipe_id` int(11) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`html` blob,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
關於mysql2的SO問題:http://stackoverflow.com/questions/ 3001243 /紅寶石軌-mysql2-寶石不-有人使用,這-寶石是 - 它穩定 – Teoulas 2010-11-03 19:06:35