Uploaded image for project: 'SX Spring Python'
  1. SX Spring Python
  2. SESPRINGPYTHONPY-94

Add charset argument to MySQLConnectionFactory

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • None
    • None
    • Database
    • None

    Description

      The MySQLConnectionFactory should have a charset argument.
      In different environments, mysql handles data as latin-1, also when the whole settings are set to utf-8.

      Example below:

      class MySQLConnectionFactory(ConnectionFactory):
      def _init_(self, username = None, password = None, hostname = None, db = None, charset='utf-8'):

      def connect(self):
      """The import statement is delayed so the library is loaded ONLY if this factory is really used."""
      import MySQLdb
      return MySQLdb.connect(self.hostname, self.username, self.password, self.db, charset)

      Attachments

        Activity

          People

            gregturn Greg Turnquist
            swilhelm Sven Wilhelm
            Archiver:
            tmarshall Trevor Marshall

            Dates

              Created:
              Updated:
              Resolved:
              Archived: