Ruby gets the value of Encoding.default_external from the environment in
which it runs.  In your case, being Windows, I have no idea, and I doubt it
will be a trivial exercise.  Windows is somewhat UTF-8 hostile, from my
limited experiences with it..

- Matt

On Fri, Aug 14, 2015 at 11:26:17AM +0100, tynamite wrote:
> When I type
> ruby -e 'p Encoding.default_external
> into the console it comes up with the encoding being CP850 instead of
> UTF-8. How do I change it?
> 
> On 13 August 2015 at 23:19, Matt Palmer <[email protected]> wrote:
> 
> > Some part of your system isn't configured for UTF-8, then.  If it were, the
> > bytes that represent the "pound currency" symbol would be a UTF-8
> > codepoint,
> > instead of the ISO-8859-1 codepoint that it is putting in.
> >
> > - Matt
> >
> > On Thu, Aug 13, 2015 at 03:38:02PM +0100, tynamite wrote:
> > > The string that is causing the problem is the Ł character. I am typing it
> > > directly from my keyboard and am not copying it from anywhere else.
> > >
> > > I put Sequel::Model.plugin :force_encoding, 'UTF-8' in my model file and
> > it
> > > didn't fix the problem.
> > >
> > > On 13 August 2015 at 14:59, Jeremy Evans <[email protected]> wrote:
> > >
> > > > On Thursday, August 13, 2015 at 3:51:09 AM UTC-7, desbest wrote:
> > > >>
> > > >> I tried to insert this into my heroku postgres database.
> > > >>
> > > >> In Britain, if a child doesn't go to school for a day, the parent
> > gets in
> > > >> big trouble and depending on the school, the parent might might
> > require a
> > > >> written note **in advance**** or even be charged Ł60 a day for each
> > > >> day's absence. If teachers are going to implement strict punishments
> > when
> > > >> school attendance isn't essential, why should teachers be allowed to
> > strike?
> > > >>
> > > >> And got this error.
> > > >>
> > > >> Problem making a comment with ajax. PG::CharacterNotInRepertoire:
> > ERROR:
> > > >> invalid byte sequence for encoding "UTF8": 0xa3
> > > >>
> > > >> Sequel::Model.plugin :force_encoding, 'UTF-8'
> > > >> :encoding => 'utf8'
> > > >>
> > > >>
> > > >>
> > > >>> I've tried using a new blank database and it didn't help.
> > > >>
> > > >>
> > > > It sounds like your database is already in UTF-8 encoding.  However,
> > you
> > > > submitted a string that wasn't in UTF-8 encoding, which caused the
> > database
> > > > to return an error instead of accepting the query.  The force_encoding
> > > > plugin should make it so the models use UTF-8, but there are still
> > cases
> > > > where things will not work. For example, if the string you give it is
> > > > marked as UTF-8 but contains non-UTF-8 data.  Could you put together a
> > self
> > > > contained example showing the problem?
> > > >
> > > > Thanks,
> > > > Jeremy
> > > >
> > > > --
> > > > You received this message because you are subscribed to a topic in the
> > > > Google Groups "sequel-talk" group.
> > > > To unsubscribe from this topic, visit
> > > > https://groups.google.com/d/topic/sequel-talk/4JyMmS6Wz5U/unsubscribe.
> > > > To unsubscribe from this group and all its topics, send an email to
> > > > [email protected].
> > > > To post to this group, send email to [email protected].
> > > > Visit this group at http://groups.google.com/group/sequel-talk.
> > > > For more options, visit https://groups.google.com/d/optout.
> > > >
> > >
> > > --
> > > You received this message because you are subscribed to the Google
> > Groups "sequel-talk" group.
> > > To unsubscribe from this group and stop receiving emails from it, send
> > an email to [email protected].
> > > To post to this group, send email to [email protected].
> > > Visit this group at http://groups.google.com/group/sequel-talk.
> > > For more options, visit https://groups.google.com/d/optout.
> >
> > --
> > My favourite was some time ago, and involved a female customer thanking
> > "Mr.
> > Daemon" for his effort trying to deliver her mail, and offering him a "good
> > time" if he ever visited Sydney.
> >                 -- Matt McLeod
> >
> > --
> > You received this message because you are subscribed to a topic in the
> > Google Groups "sequel-talk" group.
> > To unsubscribe from this topic, visit
> > https://groups.google.com/d/topic/sequel-talk/4JyMmS6Wz5U/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to
> > [email protected].
> > To post to this group, send email to [email protected].
> > Visit this group at http://groups.google.com/group/sequel-talk.
> > For more options, visit https://groups.google.com/d/optout.
> >
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sequel-talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sequel-talk.
> For more options, visit https://groups.google.com/d/optout.

-- 
Java/XML are the hammer and the Internet is the thumb.
                -- rone, in a place that does not exist

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to