incorrect string value

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

incorrect string value

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

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: incorrect string value

belgoros


On Monday, 5 November 2018 20:19:00 UTC+1, fugee ohu wrote:
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 [hidden email].
To post to this group, send email to [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: incorrect string value

Tales Cione
You say when you are importing to DB? Usually you should have utf8mb4 as your encoding in that case :)
--
Tales.


On Thu, Nov 8, 2018 at 6:27 AM belgoros <[hidden email]> wrote:


On Monday, 5 November 2018 20:19:00 UTC+1, fugee ohu wrote:
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 [hidden email].
To post to this group, send email to [hidden email].
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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: incorrect string value

Rob Jonson
In reply to this post by fugee ohu


On Monday, 5 November 2018 19:19:00 UTC, fugee ohu wrote:
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 [hidden email].
To post to this group, send email to [hidden email].
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.