Problem with Umlauts in MySQL

Posts from previous Beta sessions

Problem with Umlauts in MySQL

Postby poetter » Sat Sep 29, 2007 4:41 am

Hi,

Subxero reported a problem that from his chars Zaröx, Zärox and Zäröx only one is inserted into roster.

Well that has nothing to do with ArmorySnyc nor roster nor mysql.

Try the following. Create a test database and insert this data:

Code: Select all
/*
SQLyog Community Edition- MySQL GUI v5.22a
Host - 5.0.45-community-nt : Database - test
*********************************************************************
Server version : 5.0.45-community-nt
*/


/*!40101 SET NAMES utf8 */;

/*!40101 SET SQL_MODE=''*/;

create database if not exists `test`;

USE `test`;

/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;

/*Table structure for table `test` */

DROP TABLE IF EXISTS `test`;

CREATE TABLE `test` (
  `name` varchar(12) character set utf8 default NULL,
  `id` int(11) NOT NULL auto_increment,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

/*Data for the table `test` */

insert  into `test`(`name`,`id`) values ('ä',3),('a',4);

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;


Now take your favorite mysql client a do this query:

Code: Select all
select    `name`, `id`
   from
   `test`.`test`
   where name = 'a';


And now be astonished! :shock:

The answer is complicated and has to do with DIN norm which says that ä and a are equal. See here (Its german, so run trough google translator, should be enough to undertstand).

As UTF8 is a collection of all national standards, the DIN norm is in it and we have to live with that crap.

So the only solution to this would be storing the member names html encoded.

What do you think?
Image
User avatar
poetter
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 462
Joined: Sat Jun 30, 2007 9:41 pm
Location: Germany/Hamburg

Problem with Umlauts in MySQL

Postby zanix » Sat Sep 29, 2007 5:00 am

Oh that's crap...
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US


Return to Archived

Who is online

Users browsing this forum: No registered users and 1 guest

cron