When I enter text in a field in the data tab and use national (swedish) chars, like å ä ö, theese are stored as iso-8859-1, even when the collation is set to utf-8.
Is it possible to convert the entered text into correct collation?
utf-8 chars conversion when store data
CREATE TABLE IF NOT EXISTS `sida` (
`sida_id` int(10) NOT NULL AUTO_INCREMENT,
`code` varchar(50) COLLATE utf8_swedish_ci NOT NULL,
`titel` varchar(50) COLLATE utf8_swedish_ci NOT NULL,
`taborder` int(10) NOT NULL DEFAULT '0',
`enable` int(10) NOT NULL DEFAULT '1',
`updated` datetime NOT NULL,
PRIMARY KEY (`sida_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;
`sida_id` int(10) NOT NULL AUTO_INCREMENT,
`code` varchar(50) COLLATE utf8_swedish_ci NOT NULL,
`titel` varchar(50) COLLATE utf8_swedish_ci NOT NULL,
`taborder` int(10) NOT NULL DEFAULT '0',
`enable` int(10) NOT NULL DEFAULT '1',
`updated` datetime NOT NULL,
PRIMARY KEY (`sida_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;
My PHP site run in utf-8 and everything is ok, and everything is okay when I store text from php into db.
I _only_ taking about when I write text in fields inside HeidiSQL. I want some feature that "convert" written åäö into utf-8 and store it in db.
Is is possible?
I _only_ taking about when I write text in fields inside HeidiSQL. I want some feature that "convert" written åäö into utf-8 and store it in db.
Is is possible?
That's what I was trying to explain - your table and its columns are already utf8 "compatible", and so is HeidiSQL itself. You should never see broken chars like å or similar in that table. If you would see these, some client, PHP or whatever did that with a Latin1 based connection, and your data is broken!
the problem was probably not character_set_server but character_set_client, which is also changed by SET NAMES.
Please login to leave a reply, or register at first.