Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2584 closed defect (worksforme)

no MySQL codepage select

Reported by: 235 Owned by: Adrian Holovaty
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:

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)

Change History (5)

comment:1 Changed 10 years ago by Adrian Holovaty

Resolution: duplicate
Severity: majornormal
Status: newclosed

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
Status: closedreopened

comment:4 Changed 10 years ago by mir@…

Resolution: worksforme
Status: reopenedclosed

still duplicate of #952 ...

comment:5 Changed 10 years ago by mir@…

Oops, I meant to close it as duplicate.

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