Ruby on Rails Monday, December 26, 2011

Hi Loganathan,


I guess this might help you with your issue.

Try using this helper:

http://snippets.dzone.com/posts/show/4527

It puts a method utf8? on the String. So you can grab the String from mysql and see if it is utf8:

 my_string.utf8?

If is not, then you can try change the encoding of your String using other methods like:

 my_string.asciify_utf8
my_string
.latin1_to_utf8
my_string
.cp1252_to_utf8
my_string
.utf16le_to_utf8

Maybe this String is saved on mysql in one of these encodings.


On Mon, Dec 26, 2011 at 2:45 PM, loganathan sellappa <loganathan.ms@gmail.com> wrote:
Hi Pradeep,

Thanks for your response, I just need to check the string,
string="ABCDabcd123"
string.encoding.name
it shows IBM4378, but I want to know whether the string is under UTF-8 encoding format or not

regards,
Loganathan





On Mon, Dec 26, 2011 at 5:53 PM, Pradeep <mspradeepan@gmail.com> wrote:
Hi Loganatha,

Please check this link, let me know if this what you are looking for


Thanks
Pradeepan

On Mon, Dec 26, 2011 at 12:13 PM, loganathan sellappa <loganathan.ms@gmail.com> wrote:
Hi All,

I want to check whether the input string is in UTF-8 encoding formate, I googled but didnt get any fruitful results, pls assit me , thanks in advance.

regards,
Loganathan



--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment