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 <
[email protected]> 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 <[email protected]> wrote:
>
>> Hi Loganatha,
>>
>> Please check this link, let me know if this what you are looking for
>>
>>
>> http://blog.twodividedbyzero.net/2009/11/adding-accept-charset-attribute-to-html.html
>>
>>
>> Thanks
>> Pradeepan
>>
>> On Mon, Dec 26, 2011 at 12:13 PM, loganathan sellappa <
>> [email protected]> 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 [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected].
>>> 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 [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> 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 [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> 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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to