Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## my.cnf
- init_connect=’SET collation_connection = utf8_unicode_ci; SET NAMES utf8;’
- character_set_server = utf8
- collation_server=utf8_unicode_ci
- default-character-set=utf8
- default-collation=utf8_unicode_ci
- ## config/database
- development:
- adapter: mysql2
- database: mapp_development
- username: root
- password:
- encoding: utf8
- ## mysql table desc
- NAME TYPE COLLATION NUL KEY DEFAUL EXTRA PRIVILEGES
- id int(11) {null} NO PRI {null} auto_increment select,insert,update,references
- created_at datetime {null} YES {null} select,insert,update,references
- updated_at datetime {null} YES {null} select,insert,update,references
- user_id int(11) {null} YES MUL {null} select,insert,update,references
- address_id int(11) {null} YES {null} select,insert,update,references
- html_body mediumtext utf8_general_ci YES {null} select,insert,update,references
- ## Funny data (selected excerpts from an email - the whole email behaves the same as this section, it's just a lot longer =)
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <BODY>(this stuff gets inserted)
- <P><FONT size=2><FONT color=white>ÄÑ¿Ž£¬ÏñžöÀÏÍ·Â𣿡±¡°ÄÑ¿Ž£¬ÄÑ¿ŽŒ«ÁË£¬¿ÉÎÒ²»žÒ¶ÔÄã˵¡£¿ì§×Å<BR></FONT>¡ô ²Î ¿Î ¶Ô Ïó £º ×Ü Ÿ Àí ¡¢ Ïú ÊÛ
- ×Ü Œà ¡¢ Çø Óò Ÿ Àí ¡¢ Ïú ÊÛ Ÿ Àí ¡¢ Òµ Îñ Žú ±í Ïú ÊÛ Åà ѵ ך Ô±<FONT
- color=white>º£À«ÆŸÓãÔŸ£¬ÌìžßÈÎÄñ·É<BR></FONT><FONT size=3
- this stuff gets truncated
- ## Rails Console
- ree-1.8.7-head :043 > email = Email.new
- => #<Email id: nil, from: nil, from_addrs: nil, to: nil, to_addrs: nil, reply_to: nil, subject: nil, received: nil, date: nil, created_at: nil, updated_at: nil, user_id: nil, address_id: nil, original_source: nil, attachment_count: nil, text_body: nil, html_body: nil>
- ree-1.8.7-head :039 > email.html_body = File.read('/tmp/mail_segment.html')
- => "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\r\n<BODY>(this stuff gets inserted)\r\n<P><FONT size=2><FONT color=white>��\277\264\243\254��\270����\267��\243\277\241\261\241\260��\277\264\243\254��\277\264\274\253��\243\254\277��Ҳ\273\270Ҷ���˵\241\243\277�§��<BR></FONT>\241� �� \277� \266� �� \243\272 �� \276\255 �� \241\242 �� �� \r\n�� \274� �\242 �� �� \276\255 �� \241\242 �� �� \276\255 �� \241\242 ҵ �� \264� �� �� �� �� ѵ ר Ա<FONT \r\ncolor=white>\272\243��ƾ��Ծ\243\254��\270�������<BR></FONT><FONT size=3 \r\nthis stuff gets truncated\r\n"
- ree-1.8.7-head :040 > email.save(:validate => false)
- => true
- ree-1.8.7-head :041 > email.html_body
- => "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\r\n<BODY>(this stuff gets inserted)\r\n<P><FONT size=2><FONT color=white>��\277\264\243\254��\270����\267��\243\277\241\261\241\260��\277\264\243\254��\277\264\274\253��\243\254\277��Ҳ\273\270Ҷ���˵\241\243\277�§��<BR></FONT>\241� �� \277� \266� �� \243\272 �� \276\255 �� \241\242 �� �� \r\n�� \274� �\242 �� �� \276\255 �� \241\242 �� �� \276\255 �� \241\242 ҵ �� \264� �� �� �� �� ѵ ר Ա<FONT \r\ncolor=white>\272\243��ƾ��Ծ\243\254��\270�������<BR></FONT><FONT size=3 \r\nthis stuff gets truncated\r\n"
- ree-1.8.7-head :042 > email.reload
- => #<Email id: 1530, from: nil, from_addrs: nil, to: nil, to_addrs: nil, reply_to: nil, subject: nil, received: nil, date: nil, created_at: "2011-04-20 18:19:06", updated_at: "2011-04-20 18:19:06", user_id: nil, address_id: nil, original_source: nil, attachment_count: nil, text_body: nil, html_body: "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transit...">
- ree-1.8.7-head :043 > email.html_body
- => "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\r\n<BODY>(this stuff gets inserted)\r\n<P><FONT size=2><FONT color=white>"
- ## mysql logs
- SQL (1.0ms) describe `emails`
- AREL (0.2ms) INSERT INTO `emails` (`address_id`, `original_source`, `received`, `updated_at`, `html_body`, `to`, `subject`, `date`, `created_at`, `from_addrs`, `from`, `text_body`, `to_addrs`, `attachment_count`, `user_id`, `reply_to`) VALUES (NULL, NULL, NULL, '2011-04-20 18:19:06', '<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\r\n<BODY>(this stuff gets inserted)\r\n<P><FONT size=2><FONT color=white>�ѿ���������ͷ�𣿡����ѿ����ѿ����ˣ����Ҳ��Ҷ���˵����§��<BR></FONT>�� �� �� �� �� �� �� �� �� �� �� �� \r\n�� �� �� �� �� �� �� �� �� �� �� �� �� ҵ �� �� �� �� �� �� ѵ ר Ա<FONT \r\ncolor=white>����ƾ��Ծ������������<BR></FONT><FONT size=3 \r\nthis stuff gets truncated\r\n', NULL, NULL, NULL, '2011-04-20 18:19:06', NULL, NULL, NULL, NULL, NULL, NULL, NULL)
- SQL (0.1ms) COMMIT
- Email Load (0.3ms) SELECT `emails`.* FROM `emails` WHERE (`emails`.`id` = 1530) LIMIT 1
Add Comment
Please, Sign In to add comment