Skip to content

Title: How to configure JSON encoding options for JSON columns in Medoo #1131

@alexeydovolny

Description

@alexeydovolny

I'm working with JSON columns in Medoo and facing an issue with Cyrillic characters encoding. When inserting data into a JSON column (using syntax like content[JSON]), Cyrillic characters are being escaped in the database.

Current behavior:

  • JSON data with Cyrillic: {"text":"\u0422\u0435\u0441\u0442"}
  • Expected result: {"text":"Тест"}

Is there a way to configure Medoo to use specific JSON encoding options, particularly:

  • JSON_UNESCAPED_UNICODE
  • JSON_UNESCAPED_SLASHES

Example of my current code:

$database->insert("table_name", ["content[JSON]" => ["text" => "Тест"]]);

Database details:

  • Medoo version: 2.1.12
  • PHP version: 8.3

Any help would be appreciated. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions