Forum: Ruby on Rails encoding-differences in mysql/ruby-bindings and mysql/native

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E48d29dc8fedb2878fa518d41cc63d88?d=identicon&s=25 JanPrill (Guest)
on 2005-12-02 14:38
(Received via mailing list)
Hi, List,

after testing my current project on EdgeRails I've realised that the
connections to mysql gets lost. This is while I'm on Windows Server
2003, ruby 1.8.2 and EdgeRails. I've experienced these connection losses
some time ago after updating to Rails 1.0rc4 and got around it by
commenting out a line containing mysql411 in mysql_adapert.rb. But this
don't seem to be the problem any longer in EdgeRails since this line
isn't present in the current mysql_adapter.rb of trunk. So I decided to
give the native-mysql bindings another try. Something I gave up on the
last time I've experienced this problem because of the difficulties that
are coming with the compiling of mysql-2.7 on windows. Anyway: This time
I've compiled my own version of mysql.so and also tried the one that
comes with "Ruby on Apache".

My problem now is that connection to mysql works again, but while I'm
retrieving, updating or inserting records to mysql 5.0 tables with
encoding of utf-8 my actions result in incorrect encodings. Accented
characters and other special characters are broken because of this. The
mysql/ruby-bindings didn't have this problem. Has anyone run into this
and could give me a clue what is going on here?

Regards
Jan Prill
E48d29dc8fedb2878fa518d41cc63d88?d=identicon&s=25 JanPrill (Guest)
on 2005-12-02 15:22
(Received via mailing list)
Hi List,

just to answer my own question:

After adding encoding: utf8 (# NOT utf-8 or UTF-8) to
config/database.yml the encoding-problems are gone with the wind. And
guess what: Running on EdgeRails and mysql-native-bindings seems to
result in a 300-400% performance increase in development mode. Most of
it would be the native-bindings I guess. This is no news for the readers
of rubyonrails weblog, but for me it's a great improvement as I've
managed to get it working for the first time on windows without the
encoding-problems.

Regards
Jan
A2b2f4ee23989dc68529baef9cbddcd6?d=identicon&s=25 listbox (Guest)
on 2005-12-02 16:19
(Received via mailing list)
On 2-dec-2005, at 14:37, Jan Prill wrote:

> bindings another try. Something I gave up on the last time I've
> anyone run into this and could give me a clue what is going on here?
I am running two apps on edge rails on OS X and FreeBSD, with MySQL
4.1 and everything works fine (both apps are in Russian).
Are you sure you got your tables, columns et al CHARSET'ted properly?
Are you sure that you have your encoding set up as utf8 in the
database.yml? (no dashes?)

However I use my own legacy plug-in to configure the charset.

If so, it ought to be something with the 5.0 branch.
A2b2f4ee23989dc68529baef9cbddcd6?d=identicon&s=25 listbox (Guest)
on 2005-12-02 16:23
(Received via mailing list)
On 2-dec-2005, at 15:19, Jan Prill wrote:

> Hi List,
>
> just to answer my own question:
>
> After adding encoding: utf8 (# NOT utf-8 or UTF-8) to config/
> database.yml the encoding-problems are gone with the wind.

So I was right on that one. Glad you got it sorted out.
Actually this ought to raise an exception of MySQL can't configure
the charset, I will look at the sources.
This topic is locked and can not be replied to.