1. Chris Moffitt
  2. satchmo
  3. Issues
Issue #753 wontfix

Add charset checking to management command satchmo_check.

Anonymous created an issue

The documentation now suggests adding an init_command in settings to try and fix the persistent load errors on l10n data.

Unfortunately, at least for MySQL 5.0.x on Windows, it doesn't work. Probably not for Unix either.

Possibly a better test would be to actually check it in the satchmo_check management command. Code for mysql would be roughly as follows:

from django.db import connection if connection.connection.class.module == 'MySQLdb.connections': unless connection.connection.character_set_name() = 'utf8': # Report an error! elif ... # postgres.

No clue if the other Python DB APIs have the connection set name in the same place.

Reported by ash

Comments (2)

  1. Anonymous

    Let's try without the Wiki formatting...

    from django.db import connection
    
    if connection.connection.__class__.__module__ == 'MySQLdb.connections':
        unless connection.connection.character_set_name() = 'utf8':
            # Report an error!
    elif ... # postgres. 
    
  2. Log in to comment