Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4028700
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:15:11+00:00 2026-05-20T11:15:11+00:00

EDIT: I completely reworked this question to reflect my better understanding of the problem

  • 0

EDIT:
I completely reworked this question to reflect my better understanding of the problem

The PYODBC+MYSQL command used to fetch all table names in my DB

cursor.execute("select table_name from information_schema.tables where
             table_schema='mydbname'")

The result is a list of unicode strings with every second character omitted, in each string.

The information_schema DB is utf8, although my table names are pure ascii. Reading from my DB which is latin1 works fine. Executing set character_set_* = 'utf8' does not help.

Executing the same query from a C++/ODBC test program works fine.

Do you know how pyodbc works wrt to character encoding? What encoding does it assume when working with a utf8 DB?

I work on Linux with UnixODBC, python 2.6.4, pyodbc 2.1.7

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T11:15:12+00:00Added an answer on May 20, 2026 at 11:15 am

    The ODBC specification only allows two encodings: ASCII and UCS-2. It is the job of the ODBC driver to convert whatever the database is in to one of those two, but I find most ODBC driver authors don’t understand how it is supposed to work.

    When a query is executed, pyodbc does not ask for any encoding. It executes the query and then asks the driver for the data type of each column. If the data type is Unicode, it will read the buffer and treat it as UCS2. If the data type is ASCII, it will read the buffer and treat it as ASCII.

    The storage format is supposed to be irrelevant.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Edit: I don't think I asked this question very well. I'm completely re-phrasing it
EDIT : I completely re-wrote the question since it seems like I was not
edit: I completely rewrote the question as the original one didn't clearly explain my
EDIT 07/14 As Bill Burgess mentionned in a comment of his answer, this question
I want to stop all the IPs and subdomains completely. Someone edit/modify it so
EDIT I accidentaly found a walk around to this problem... Adding the following line
EDIT : based on feedback, erased original Q. completely and reposting in better language
Edit: I re-asked this same question (after fixing the problems noted with this question)
EDIT : please note: i completely re-explained my question. I have application with two
EDIT 1 I do not exclude at all this might be caused by something

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.