New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emoji totally breaks comments #35

Closed
steveklabnik opened this Issue Nov 5, 2012 · 7 comments

Comments

Projects
None yet
3 participants
@steveklabnik

This comment has been minimized.

Show comment
Hide comment
@steveklabnik

steveklabnik Nov 5, 2012

This comment has 👍 in it.

steveklabnik commented Nov 5, 2012

This comment has 👍 in it.

@rjsamson

This comment has been minimized.

Show comment
Hide comment
@rjsamson

rjsamson Nov 5, 2012

Contributor

I was actually just about to post the same issue. Interestingly enough the full text of your reply showed up just fine in the email reply notification that I received when you replied to my comment: screenshot
So it seems to be something that happens after reply notifications are sent.

Contributor

rjsamson commented Nov 5, 2012

I was actually just about to post the same issue. Interestingly enough the full text of your reply showed up just fine in the email reply notification that I received when you replied to my comment: screenshot
So it seems to be something that happens after reply notifications are sent.

@jcs

This comment has been minimized.

Show comment
Hide comment
@jcs

jcs Nov 5, 2012

Contributor

I just looked in the database and there are no characters in the table after "A big ".

 mysql> select comment, length(comment) from comments where short_id = 'mppo6p';
 +-------------+-----------------+
 | comment     | length(comment) |
 +-------------+-----------------+
 | Yep. A big  |              11 |
 +-------------+-----------------+

I can see the full text of the comment in the production.log, and it's obviously making its way to the e-mail notification, but getting truncated at the point where \xf0\x9f\x91\x8d begins when writing to MySQL.

It's MySQL 5.1 with a utf8 table (encoding: utf8 in database.yml) and Rails/AR 3.2.6 (mysql2 0.3.11 gem) if you want to figure it out.

Contributor

jcs commented Nov 5, 2012

I just looked in the database and there are no characters in the table after "A big ".

 mysql> select comment, length(comment) from comments where short_id = 'mppo6p';
 +-------------+-----------------+
 | comment     | length(comment) |
 +-------------+-----------------+
 | Yep. A big  |              11 |
 +-------------+-----------------+

I can see the full text of the comment in the production.log, and it's obviously making its way to the e-mail notification, but getting truncated at the point where \xf0\x9f\x91\x8d begins when writing to MySQL.

It's MySQL 5.1 with a utf8 table (encoding: utf8 in database.yml) and Rails/AR 3.2.6 (mysql2 0.3.11 gem) if you want to figure it out.

@jcs

This comment has been minimized.

Show comment
Hide comment
@jcs

jcs Nov 5, 2012

Contributor

I can also reproduce this on my Mac with a MySQL 5.5 server, same DB structure.

Contributor

jcs commented Nov 5, 2012

I can also reproduce this on my Mac with a MySQL 5.5 server, same DB structure.

@jcs

This comment has been minimized.

Show comment
Hide comment
@jcs

jcs Nov 8, 2012

Contributor

Committed hack in 9ece666 to temporarily work around this problem by stripping out emoji.

Contributor

jcs commented Nov 8, 2012

Committed hack in 9ece666 to temporarily work around this problem by stripping out emoji.

@jcs jcs closed this Nov 8, 2012

@jcs jcs reopened this May 26, 2013

@jcs

This comment has been minimized.

Show comment
Hide comment
@jcs

jcs May 26, 2013

Contributor

upgraded server to mariadb, changed tables to utf8mb4, using git version of mysql2 gem, emoji works now

https://lobste.rs/s/mycvzo/learning_to_program_and_when_to_start_building_your_own_app/comments/fhc74c

Contributor

jcs commented May 26, 2013

upgraded server to mariadb, changed tables to utf8mb4, using git version of mysql2 gem, emoji works now

https://lobste.rs/s/mycvzo/learning_to_program_and_when_to_start_building_your_own_app/comments/fhc74c

@jcs jcs closed this May 26, 2013

@steveklabnik

This comment has been minimized.

Show comment
Hide comment
@steveklabnik

steveklabnik May 26, 2013

I can confirm that this totally works. 🤘

steveklabnik commented May 26, 2013

I can confirm that this totally works. 🤘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment