What should I do to get the accented character in MySql?

I used select char(148); to get the accented character ‘ö’ , but the result was hexadecimal 0x94 , how to get the wanted character?

Answer

The CHAR function also supports a optional charset parameter.

https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_char

CHAR(N,… [USING charset_name])

I’m not sure in which charset the number 148 corresponds the character you mention ö ( it’s not that number in utf-8, the default charset as of MySQL 8 ), but you should be able to provide the charset from this list here to the CHAR function to get the results you expect.