incompatible character encodings ruby

I'm getting the following error with my Ruby 1.9

I tried using (as some resources suggested)


But it didn't help!

Any ideas how to resolve this? Is there a way to eliminate such characters before saving to DB? or is a there a way to make them show?

For example, when I want to print:

Opowieść o kulcie przemocy

I get:

Opowie?? o kulcie przemocy


I make it work using this first line of code:

# encoding: UTF-8

string = "Opowieść o kulcie przemocy"
p string.force_encoding('utf-8')

when i write to the DB , I use the encode and not the force_encoding , for example:


where sql is the statement containing the text that needs to be encoded


 ? Ruby windows-1250 encoding
 ? String encoding issue in Ruby
 ? Ruby: Error encoding:"UTF-8"
 ? String Encoding in Ruby
 ? Ruby compatibility error encoding
 ? What's the behavior the browser encoding URL?
 ? ERROR: when installing electron?
 ? Node writeFileSync encoding options for images
 ? UTF8 characters come out as windows-1252, ExpressJS running on Electron
 ? RSA encrypt/decrypt failing in my own implementation in python