Django

Code

Ticket #2584 (closed: worksforme)

Opened 2 years ago

Last modified 2 years ago

no MySQL codepage select

Reported by: 235 Assigned to: adrian
Milestone: Component: Database layer (models, ORM)
Version: SVN Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Django works only with utf8 codepage in MySQL, it's great problem with using it in others codepages. In django/db/backends/mysql/base.py hardcode defined MySQL codepage.

if self.connection.get_server_info() >= '4.1':
  cursor.execute("SET NAMES utf8")

There only one possibility to change it manualy. Other variant is to move this option out to settings.py as MYSQL_CODEPAGE or try to extract this data from DEFAULT_CHARSET, as it was recommended on local forum:

from django.config import settings
...
if self.connection.get_server_info() >= '4.1':
  cs = settings.DEFAULT_CHARSET.replace('-', '')
  cursor.execute("set character set %s" % cs)

Attachments

Change History

08/21/06 17:04:33 changed by adrian

  • status changed from new to closed.
  • resolution set to duplicate.
  • severity changed from major to normal.

Duplicate of #952.

08/22/06 05:03:46 changed by 235

Ohh, great, but we still haven't that path applied in SVN code. That defect was reported 9 month ago. We've spend an hour to find this bug, and it would be very pleasant to apply it.

08/22/06 05:12:43 changed by anonymous

  • status changed from closed to reopened.
  • resolution deleted.

01/30/07 15:55:29 changed by mir@noris.de

  • status changed from reopened to closed.
  • resolution set to worksforme.

still duplicate of #952 ...

01/30/07 16:03:59 changed by mir@noris.de

Oops, I meant to close it as duplicate.


Add/Change #2584 (no MySQL codepage select)




Change Properties
Action