APK errors

In MySQL the letter ə becomes a question mark

ə is two bytes. The old utf8 can store it. The break usually comes from the connection: the program sends the text as latin1, and if the column is latin1 too, the letter becomes ?.

Make the database and the connection utf8mb4. Do not write latin1. If the letter is already ?, changing the table does not bring it back.

  • Open the database like this: CREATE DATABASE magaza CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci.
  • In Python write charset="utf8mb4". charset="latin1" and an empty charset turn ə into ?.
  • If an old column is latin1, export the text first, then make the column utf8mb4. The other order keeps ?.
  • SET NAMES utf8mb4 is for the connection. It does not change a ? that is already stored.
  • For sorting, MySQL 8 has utf8mb4_az_0900_ai_ci. A collation whose name contains az does not treat ə as e.
import pymysql

baglanti = pymysql.connect(
    host="127.0.0.1",
    user="root",
    password="",
    database="magaza",
    charset="utf8mb4",
)

Related guides