[solved] database: conversion of CHARACTER Set lazarus / 16-Databases ---------------------------------------------------------------------- Nicole · 2024-01-25 19:39 After having prinred my DLL, I discovered something, I do not enjoy: one field:   BEZEICHNUNG varchar(50) CHARACTER SET ISO8859_1 COLLATE DE_DE, and another one:   MYTEXT varchar(100) CHARACTER SET UTF8, Probably it would be better to have only one Character Set and I would prefer UTF8. Is it possible to transport from ISO8859_1 to UTF8 without data-loss? And if conversion is possible: How can I do it? Or would you rather recommend to take the ISO8859_1? ---------------------------------------------------------------------- Zvoni · 2024-01-26 07:58 Just add new columns (maybe even in a new table) with the "new" Characterset/Collation, and throw all records at it. If there is something wrong, the DB will complain ---------------------------------------------------------------------- kwyan · 2024-02-01 02:27 Suppose that table t has a column named BEZEICHNUNG defined as VARCHAR(50) CHARACTER SET ISO8859_1 but you want to convert it to use utf8mb4 so that you can store values from many languages. The following statement accomplishes this: Code: MySQL  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ALTER TABLE t MODIFY BEZEICHNUNG VARCHAR(50) CHARACTER SET utf8mb4; https://dev.mysql.com/doc/refman/8.0/en/charset-conversion.html Whether to use ISO8859_1 or UTF8MB4 depends on your application design. One reason is: If you receive data from a screen where you have no control over what characters can be accepted, UTF8MB4 may be a good choice. If you have validation on the screen which only accepts ISO8859_1 characers, you may choose this characer set. ---------------------------------------------------------------------- Zvoni · 2024-02-01 07:46 Quote from: kwyan on February 01, 2024, 03:27:54 amSuppose that table t has a column named BEZEICHNUNG defined as VARCHAR(50) CHARACTER SET ISO8859_1 but you want to convert it to use utf8mb4 so that you can store values from many languages. The following statement accomplishes this: Code: MySQL  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ALTER TABLE t MODIFY BEZEICHNUNG VARCHAR(50) CHARACTER SET utf8mb4; https://dev.mysql.com/doc/refman/8.0/en/charset-conversion.html Whether to use ISO8859_1 or UTF8MB4 depends on your application design. One reason is: If you receive data from a screen where you have no control over what characters can be accepted, UTF8MB4 may be a good choice. If you have validation on the screen which only accepts ISO8859_1 characers, you may choose this characer set. Nicole uses Firebird, not MySQL