0

from my old project what need to get to new one i need same database records and there all are in latvian language, there is symbols what is not latvian, any encoding solution didn't help Example:

Have NotekÅ«deņu sÅ«knis but need Notekūdeņu sūknis

In database all text that is in latvian is with this symbols, english letters is ok

HAVE  =  NEED
  Ä�  =  ā
  Ä“  =  ē
  Å«  =  ū
  Å   =  ņ
  Ä«  =  ī
  Ä£  =  ģ
  Å¡  =  š
  †Ä· =  ķ

Cant find any solution. My PHP v8.0 use MySql MariaDB v10.9.3

Maybe only solution is to rewrite all DB records in latvian language or this will e mistake?

Or someone can help me how to change all wrong characters in database

HELP SOMEOE PLEASE

Jazek
  • 1
  • 2
  • Why not fix the encoding in the database, rather than in PHP code? – Nico Haase Oct 17 '22 at 09:58
  • If you can figure out how that got mangled, you can reverse the process. That looks like it got scrambled from UTF-8 given the 2-byte format. Are you sure you have the correct character encoding for what's in the database? – tadman Oct 17 '22 at 09:58
  • 1
    You haven't actually said *where* you're seeing this. Is that what's directly stored in MariaDB (e.g. the output of a `SELECT` query run directly against the database)? Or are you seeing that on a web page where PHP has connected to MariaDB and is then outputting what you deem incorrect? You need to identify the source of the "incorrect" data (MariaDB, or later on PHP, etc) before being able to fix it. But essentially it will come down to the character encoding/locale used by your database server or PHP config depending on where the actual problem is. – Andy Oct 17 '22 at 10:02
  • @Andy yes, this is saved in database, in old project output is correct, but in new one i cant get right output with `SELECT`. – Jazek Oct 17 '22 at 10:22

0 Answers0