(Really, this is fairly searchable on the web, although Google is pretty good at knowing what I mean.)
– Dave NewtonAug 12 '15 at 18:29
Here's [a link](http://stackoverflow.com/questions/20521371/set-utf-8-as-default-for-ruby-1-9-3) to a question asked similar to yours, answered.
– ZaderAug 12 '15 at 18:32
I'm using ruby 1.9.3. I searched google for `change ruby encoding` and didn't get any relevant results.
– desbestAug 12 '15 at 18:36
1
This seems to answer : http://stackoverflow.com/questions/20521371/set-utf-8-as-default-for-ruby-1-9-3
– Wand MakerAug 12 '15 at 18:40
None of the links you have given me work. When I try to insert `£` into my database or display the `£` symbol in an xhtml file, I get an exception that a UTF-8 character cannot be displayed on a page with CP-850 encoding. This question will explain further. http://stackoverflow.com/questions/31909569/i-receive-incompatible-character-encodings-cp850-and-utf-8-when-displaying-th I have put `# encoding: UTF-8` `Encoding.default_external = 'utf-8';
Encoding.default_internal = Encoding::UTF_8` in my ruby file and it hasn't solved the problem.
– desbestAug 12 '15 at 18:46
@desbest You said the magic word, "database". Your database will have its own encoding, usually per table.
– SchwernAug 12 '15 at 19:05
The default I/O encoding is taken from your operating system's encoding settings. How to configure your operating system is a general user question, completely unrelated to programming, thus I vote to close as off-topic. (I would vote to migrate to SuperUser, except I'm betting this has already been asked there. Plus, the question doesn't have enough information, like what operating system the OP is using.)
– Jörg W MittagAug 12 '15 at 19:06
This is not a database question @Schwern as I get an exception when I display a web page that has the `£` character on it. Also @Jörg I get the same error on Heroku, so it happens on both Windows and Linux.
– desbestAug 12 '15 at 19:12
This answer looks promising. How do I make it work? http://stackoverflow.com/a/17616076/337306
– desbestAug 12 '15 at 19:27
I can't use this answer as I don't have the LC_ALL environment variable. http://stackoverflow.com/a/17616076/337306
– desbestAug 14 '15 at 10:30