0

i have a MYSQL DB. I am storing the multi lingual characters in a table. below is the sample code.

CREATE TABLE test_multi_lang
(
    language_name varchar(500) CHARACTER SET utf8 COLLATE utf8_unicode_ci
);

SET NAMES 'utf8';

insert into test_multi_lang
(language_name )
values
('ตัวอย่าง');

insert into test_multi_lang
(language_name )
values
('नमूना');

SET NAMES 'utf8';

SET character_set_results = 'utf8', 
character_set_client = 'utf8', 
character_set_connection = 'utf8', 
character_set_database = 'utf8', 
character_set_server = 'utf8';

select * from test_multi_lang;

When i run the above code in TOAD for MYSQL 7.3.1.290 and select the result set it is displaying as ?????????. but when I run the same code through mysql console it is displaying the unicode characters properly. i changed the properties of my toad as

enter image description here

still i am not getting the result displayed in proper format. how can i solve this problem ?

Thanks in advance.

Chakradhar
  • 753
  • 6
  • 14
  • 29

3 Answers3

1

After trying different options what worked for me is the following setting in my.ini configuration file.

character_set_server=utf8

I'm using xampp and my.ini is located under c:\xampp\mysql\bin folder Here's the screenshot

To see your current settings run following command in Toad

SHOW VARIABLES LIKE '%CHARACTER_SET%'

after applying the changes it should look like this:

enter image description here

And this is how data looks after changing the setting.

screenshot of Resultset

Please note that you'll have to restart mySQL server as well as Toad for this setting to take effect. This change will not be applied retroactively to existing data. you'll have to recreate the old data.

M.A.Naseer
  • 343
  • 3
  • 9
1
SHOW CREATE TABLE

You will find that the table (or at least the text column) is not CHARACTER SET utf8. utf8 is required there.

This is a duplicate; read it for the cause and solution.

Community
  • 1
  • 1
Rick James
  • 135,179
  • 13
  • 127
  • 222
0

This is probably a display problem Toad is a non unicode software so we have to do a little setup.

You have to set NLS_LANG in regedit and add Arabic language from the region settings. For guidance you can follow the below steps:-

  • Windows -> Run -> regedit -> HKEY_LOCAL_MACHINE -> WOW6432Node -> ORACLE -> KEY_(YOUR HOME_ID) -> NS_LANG -> VALUE AMERICAN_AMERICA.AR8MSWIN1256
  • Control Panel -> Region -> Administrative -> change System Locale... -> select current system language (Arabic).
  • Restart Toad.

Enjoy & Thanks me later