Search code examples
mysqlsetcharacterutf-16

Converting MySQL database to UTF16


I am trying to create this table in a MySQL database

CREATE TABLE IF NOT EXISTS `Scania` (
  `GensetType` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `EngineType` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `Engine60Hz` int(11) NOT NULL,
  `Alternator` text CHARACTER SET utf16 COLLATE utf16_unicode_ci NOT NULL,
  `PriceEur` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

However I receive a error message as

Error 1115 <42000> : Unknown character set: 'UTF 16'

I even tried to Alter the database but I received the same error

ALTER DATABASE nordhavn charset='utf16'

I tried searching online about other methods to convert the database but failed to find any possible solutions


Solution

  • The utf16 character set is available since MySQL 5.5 and up.
    I guess you're using some earlier version.