Opened 18 years ago

Closed 17 years ago

Last modified 17 years ago

#2584 closed defect (worksforme)

no MySQL codepage select

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

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 by Adrian Holovaty, 18 years ago

Resolution: duplicate
Severity: majornormal
Status: newclosed

Duplicate of #952.

comment:2 by 235, 18 years ago

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 by anonymous, 18 years ago

Resolution: duplicate
Status: closedreopened

comment:4 by mir@…, 17 years ago

Resolution: worksforme
Status: reopenedclosed

still duplicate of #952 ...

comment:5 by mir@…, 17 years ago

Oops, I meant to close it as duplicate.

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