Discussion:
[Rails] incorrect string value
fugee ohu
2018-11-05 19:19:00 UTC
Permalink
I imported some sms messages with emoticons in them and even though I'm
setup for utf8 encoding such as foreign languages, these emoticons raise
'incorrect string value' error
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+***@googlegroups.com.
To post to this group, send email to rubyonrails-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/15930e48-d2eb-48da-84b2-471c5114e8a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
belgoros
2018-11-08 08:27:19 UTC
Permalink
Post by fugee ohu
I imported some sms messages with emoticons in them and even though I'm
setup for utf8 encoding such as foreign languages, these emoticons raise
'incorrect string value' error
Hi, have you defined on the very first line of your ruby file UTF encoding
as follows:

# encoding: utf-8
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+***@googlegroups.com.
To post to this group, send email to rubyonrails-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/4bcb0f35-045f-48da-8560-d98da0d7571e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Tales Cione
2018-11-08 10:17:06 UTC
Permalink
You say when you are importing to DB? Usually you should have utf8mb4 as
your encoding in that case :)
--
Tales.
Post by belgoros
Post by fugee ohu
I imported some sms messages with emoticons in them and even though I'm
setup for utf8 encoding such as foreign languages, these emoticons raise
'incorrect string value' error
Hi, have you defined on the very first line of your ruby file UTF encoding
# encoding: utf-8
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/4bcb0f35-045f-48da-8560-d98da0d7571e%40googlegroups.com
<https://groups.google.com/d/msgid/rubyonrails-talk/4bcb0f35-045f-48da-8560-d98da0d7571e%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+***@googlegroups.com.
To post to this group, send email to rubyonrails-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAJ_sHYNMqNCSYEc5Gkaom%2B%2BHWaJ0r%3DNAmgyqK789GVmN-WH2kQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Rob Jonson
2018-11-09 11:58:23 UTC
Permalink
Post by fugee ohu
I imported some sms messages with emoticons in them and even though I'm
setup for utf8 encoding such as foreign languages, these emoticons raise
'incorrect string value' error
https://blog.arkency.com/2015/05/how-to-store-emoji-in-a-rails-app-with-a-mysql-database/

or

https://www.google.co.uk/search?q=rails+mysql+emoji
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+***@googlegroups.com.
To post to this group, send email to rubyonrails-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7c32da58-8c79-4ce2-bc74-8af7f645bce6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...