Guest User

Untitled

a guest
Jan 5th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.52 KB | None | 0 0
  1. ## my.cnf
  2. init_connect=’SET collation_connection = utf8_unicode_ci; SET NAMES utf8;’
  3. character_set_server = utf8
  4. collation_server=utf8_unicode_ci
  5. default-character-set=utf8
  6. default-collation=utf8_unicode_ci
  7.  
  8. ## config/database
  9. development:
  10. adapter: mysql2
  11. database: mapp_development
  12. username: root
  13. password:
  14. encoding: utf8
  15.  
  16.  
  17. ## mysql table desc
  18. NAME TYPE COLLATION NUL KEY DEFAUL EXTRA PRIVILEGES
  19. id int(11) {null} NO PRI {null} auto_increment select,insert,update,references
  20. created_at datetime {null} YES {null} select,insert,update,references
  21. updated_at datetime {null} YES {null} select,insert,update,references
  22. user_id int(11) {null} YES MUL {null} select,insert,update,references
  23. address_id int(11) {null} YES {null} select,insert,update,references
  24. html_body mediumtext utf8_general_ci YES {null} select,insert,update,references
  25.  
  26. ## Funny data (selected excerpts from an email - the whole email behaves the same as this section, it's just a lot longer =)
  27.  
  28. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  29. <BODY>(this stuff gets inserted)
  30. <P><FONT size=2><FONT color=white>ÄÑ¿Ž£¬ÏñžöÀÏÍ·Â𣿡±¡°ÄÑ¿Ž£¬ÄÑ¿ŽŒ«ÁË£¬¿ÉÎÒ²»žÒ¶ÔÄã˵¡£¿ì§×Å<BR></FONT>¡ô ²Î ¿Î ¶Ô Ïó £º ×Ü Ÿ­ Àí ¡¢ Ïú ÊÛ
  31. ×Ü Œà ¡¢ Çø Óò Ÿ­ Àí ¡¢ Ïú ÊÛ Ÿ­ Àí ¡¢ Òµ Îñ Žú ±í Ïú ÊÛ Åà ѵ ך Ô±<FONT
  32. color=white>º£À«ÆŸÓãÔŸ£¬ÌìžßÈÎÄñ·É<BR></FONT><FONT size=3
  33. this stuff gets truncated
  34.  
  35. ## Rails Console
  36.  
  37. ree-1.8.7-head :043 > email = Email.new
  38. => #<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>
  39.  
  40. ree-1.8.7-head :039 > email.html_body = File.read('/tmp/mail_segment.html')
  41. => "<!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"
  42.  
  43. ree-1.8.7-head :040 > email.save(:validate => false)
  44. => true
  45.  
  46. ree-1.8.7-head :041 > email.html_body
  47. => "<!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"
  48.  
  49. ree-1.8.7-head :042 > email.reload
  50. => #<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...">
  51.  
  52. ree-1.8.7-head :043 > email.html_body
  53. => "<!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>"
  54.  
  55.  
  56. ## mysql logs
  57. SQL (1.0ms) describe `emails`
  58. 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)
  59. SQL (0.1ms) COMMIT
  60. Email Load (0.3ms) SELECT `emails`.* FROM `emails` WHERE (`emails`.`id` = 1530) LIMIT 1
  61.  
  62.  
  63.  
  64.  
  65. ## mysql logs
Add Comment
Please, Sign In to add comment