What do you mean by collation

SELFHTML Forum - Supplement to documentation Overview

echo $ greeting;

A few remaining answers:

cdcol latin1_general_ci

First of all, the latin1_general_ci value consists of three parts. The first is the coding, the second is the collation and this also includes the third part, the case (in) sensitivity.

[...] but why are these [collations] so different and when I create a new DB by default latin1_swedish_ci, am I not a Swede?

The other database creators made a default collation specification when they were created. If you do not specify a corresponding parameter in the CREATE step, a (configurable) system default value is used. Collation information for the system, the databases and the tables are only default information if no explicit information has been made for subordinate elements. Ultimately, only the details of the individual fields count, which can also be different. (The extent to which this makes sense must be considered on a case-by-case basis.)

Wouldn't it make more sense if they all had the same collation?

No, not in every case, as the sorting rules must be taken into account for each language and application.

What makes the most sense for the normal German operator, if foreign characters could also be included, but the scripts and HTML forms are not UTF-8?

As a collation, you have to take the one that suits your needs. There are at least two sorting systems in German. The individual differences can be found in the manual chapter Character Sets and Collations That MySQL Supports.

The collation is important for internal data processing (sorting, comparing). For the communication with clients, the coding (without collation, because it is not required) on the respective connection also plays an important role. This should be negotiated explicitly after each connection is established. For this there is the API function mysql_set_charachter_set (), for which there should be counterparts in the implementations of the various programming languages. If not, a "SET NAMES" statement is sufficient in this country. If the coding on the connection and that of the individual fields do not match, MySQL recodes them. Not everyone can do this in every coding loss-free, since not all characters can be represented with all codings.

If your scripts are "not UTF-8" what are they? Probably Latin1 (Windows-1252), because an encoding is always available. You then have the problem of not being able to encode various (perhaps rarely occurring) characters, which can lead to unexpected results. UTF-8 (or Unicode in general) is intended to solve these problems, but requires a one-time conversion effort, which may lead to frustration but also gain in experience.

echo "$ farewell $ name";