Changing the charset/encoding when using the db library

16 views
Skip to first unread message

Bonface Munyoki

unread,
Jul 11, 2020, 6:06:04 AM7/11/20
to Racket Users
Hi all.

I'm using racket to connect to mysql using the db library. I'd like to
do something like:

--8<---------------cut here---------------start------------->8---
`sqlalchemy.create_engine(SQL_URI+'?charset=latin1&use_unicode=0')`
--8<---------------cut here---------------end--------------->8---

basically adding the equivalent of "charset=latin1&use_unicode=0" in the
SQL_URI. I can't seem to find a way to do that in racket. Would anyone
have an idea of how I would do that?
---
Bonface M. K.(https://www.bonfacemunyoki.com/)
One Emacs to rule them all
GPG key = D4F09EB110177E03C28E2FE1F5BBAE1E0392253F

Ryan Culpepper

unread,
Jul 11, 2020, 1:15:13 PM7/11/20
to Bonface Munyoki, Racket Users
The db library expects to talk to the MySQL server using utf8. If you manage to change the connection encoding (eg with SET NAMES), it is likely to confuse the db library and either corrupt data or make the connection fail with an error.

Can you explain what you want to accomplish?

Ryan

--
You received this message because you are subscribed to the Google Groups "Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CABAzU5te7aqX%2B6oxUTK8qKr1XA%3DTL1TEL-Eco1s0_vBEC2F09Q%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages