latin1
This page is part of MariaDB's Documentation.
The parent of this page is: Character Sets for MariaDB Xpand
Topics on this page:
Overview
CP1252 West European (maxlen 1)
DETAILS
Default Collation: latin1_
swedish_ ci Max Length: 1 bytes
The collation names accepted for this character set are:
EXAMPLES
SELECT TYPEOF(_latin1'Test') AS result1,
TYPEOF(CONVERT('Test' USING latin1)) AS result2\G
*************************** 1. row ***************************
result1: varchar(255) CHARACTER SET latin1 not null
result2: varchar(65535) CHARACTER SET latin1
CREATE TABLE charset_example (
name VARCHAR(32),
description VARCHAR(64) CHARSET latin1
);
SET NAMES utf8;
SET @txt = _utf8"Dji pou magnî do vêre, çoula m' freut nén må.";
INSERT INTO charset_example VALUES
('test 1', CONVERT(@txt USING latin1)),
('test 2', 'A normal string.');
SELECT name,
LENGTH(description) AS bytes,
CHAR_LENGTH(description) AS chars
FROM charset_example;
+--------+-------+-------+
| name | bytes | chars |
+--------+-------+-------+
| test 1 | 45 | 45 |
| test 2 | 16 | 16 |
+--------+-------+-------+
SET SESSION character_set_connection = 'latin1';