incompatible character encodings: ASCII-8BIT and UTF-8

Gjermund Lunder wrote in post #965049:

Anyone know how to add this patch?: 0001-enforced-utf-8-encoding-for-ruby-19-and-mysql-text.patch

(#4683 ASCII-8BIT and UTF-8 in hell - Ruby on Rails - rails)

I've never applied such a pacth.

It's a standard *nix patch file. The patch command could read it (see its man page for more details), but the a/ and b/ file naming scheme means that you'd probably be better off using git apply.

Thanks

Gjermund

Best,

Marnen Laibow-Koser wrote in post #965150:

It's a standard *nix patch file. The patch command could read it (see its man page for more details), but the a/ and b/ file naming scheme means that you'd probably be better off using git apply.

Is possible use a patch command also under Windows? What about Git? Is it safe to install such patch for all the system also for ROR-beginners? Can I modify the source files manually (to exactly know, what have I changed)?

Gjermund Lunder wrote in post #964821:

Robert K. (or others), If you do have have the exact line for the enforce coding and in witch erb files to put it I would be happy.

To replicate this error, call:

rails -v

Rails 3.0.3

ruby - v

ruby 1.9.2p0 (2010-08-18) [i386-mingw32]

Mysql version: 5.1.45-community-log

rails new r4_test -d mysql && cd r4_test rails g scaffold post title:string content:string rem:text rake db:create rake db:migrate rails s http://localhost:3000/posts call 'New Post' to all three filends insert e.g. "löwe" or "tomáš"

After this I'll get:

incompatible character encodings: UTF-8 and ASCII-8BIT

Extracted source (around line #15): 12: 13: <p> 14: <b>Rem:</b> 15: <%= @post.rem %> 16: </p> 17: 18:

A monkey work-around

Robert K. wrote in post #965170:

A monkey work-around -------------------- A better work-around --------------------

Thanks! Perfect.

I'm also waiting for a fix in 3.0.4. As you asked: Does anyone know if patch and Git exists in windows? If no; how to apply std nix patch files?

About mysql og not. It's religion, you know :slight_smile: I've used Oracle on Unix/Linux through many years. I like mysql, though.

Gjermund Lunder wrote in post #965337:

Robert K. wrote in post #965170:

A monkey work-around -------------------- A better work-around --------------------

Thanks! Perfect.

I'm also waiting for a fix in 3.0.4. As you asked: Does anyone know if patch and Git exists in windows? If no; how to apply std nix patch files?

Git exists in Windows. A *nix-style patch command probably does too, but why are you torturing yourself with Windows? :slight_smile:

About mysql og not. It's religion, you know :slight_smile: I've used Oracle on Unix/Linux through many years. I like mysql, though.

SQLite (which Robert mentioned as his alternative) isn't suitable for production.

I no longer trust MySQL, though, and I don't see why others still do -- it's got too many silly weaknesses and stupidities. Given the choice, I'll choose PostgreSQL every time. Not religion, just being tripped up one too many times by MySQL's issues.

Best,

Hallo all,

Marnen Laibow-Koser wrote in post #965696: Git exists in Windows.

Yes, but I don't know to work with it and therefore I cannot imagine, how to update the core of rails without not to break it ):

but why are you torturing yourself with Windows? :slight_smile:

Well, most of my job I make on MS Excel tables with VBA support. Now I am trying to move to Rails, but it does not work yet... Maybe in some months I will be not more dependent on Bill's products (:

I'll choose PostgreSQL every time. Not religion, just being tripped up one too many times by MySQL's issues.

It is not first time I hear someone prefers the postgresql... A good comparison is on wikivs.com - wikivs Resources and Information..

I decided to install a postgresql gem in my Rails to check it, but I failed with: "Installing pg (0.10.0) with native extensions D:/Programs/ruby192/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) D:/Programs/ruby192/bin/ruby.exe extconf.rb checking for pg_config... no checking for libpq-fe.h... *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more"

(The same error after I ran either "gem install pg" or "bundle install")

This is to much complicated for me to solve.

Robert

Robert K. wrote in post #966327:

Hallo all,

Marnen Laibow-Koser wrote in post #965696: Git exists in Windows.

Yes, but I don't know to work with it

Learn.

and therefore I cannot imagine, how to update the core of rails without not to break it ):

I note that you conveniently neglected to quote my point that a *nix-style patch tool also probably exists for Windows. That or Git will apply a patchfile very nicely indeed.

but why are you torturing yourself with Windows? :slight_smile:

Well, most of my job I make on MS Excel tables with VBA support. Now I am trying to move to Rails, but it does not work yet... Maybe in some months I will be not more dependent on Bill's products (:

Start now! Use a *nix VM for Rails development. I understand Virtual Rails is nice.

[...]

This is to much complicated for me to solve.

Well, stop complicating things further by using Windows!

Robert

Best,