Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#2584 closed defect (worksforme)

no MySQL codepage select

Reported by: 235 Owned by: adrian
Component: Database layer (models, ORM) Version: master
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Django works only with utf8 codepage in MySQL, it's great problem with using it in others codepages.
In django/db/backends/mysql/ 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 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)

Change History (5)

comment:1 Changed 10 years ago by adrian

  • Resolution set to duplicate
  • Severity changed from major to normal
  • Status changed from new to closed

Duplicate of #952.

comment:2 Changed 10 years ago 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.

comment:3 Changed 10 years ago by anonymous

  • Resolution duplicate deleted
  • Status changed from closed to reopened

comment:4 Changed 9 years ago by mir@…

  • Resolution set to worksforme
  • Status changed from reopened to closed

still duplicate of #952 ...

comment:5 Changed 9 years ago by mir@…

Oops, I meant to close it as duplicate.

Note: See TracTickets for help on using tickets.
Back to Top