I have a set of queries which I have tried to run in mysql server using this command:
mysql -ufourint -pjabberwocky -hdb1 cafe < /tmp/bhasha_templates.txt
The file bhasha_templates.txt has been created by me in notepad using UTF 8 encoding.
I also tried encoding in UTF8 BOM and ANSI but it doesn't seem to work for the Hindi language.
Sample:
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','hindi','srp.message.noResultFound','माफ़ कीजिए। हमें कोई जानकारी नहीं मिली। क्या आप चाहेंगे');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','hindi','srp.message.noResultFoundAddListing','एक सूची जोड़ें?');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','hindi','srp.message.similarSearch','के लिए खोजें');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','hindi','srp.text.AlsoFound','यह भी पाया गया:');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','hindi','srp.text.seeAll','सभी देखिएँ');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','hindi','srp.text.seeAlso','यहाँ भी देखें');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','hindi','srp.text.suggestItems','आप अन्य देखना चाहेंगे');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','hindi','srp.text.ViewContactDetails','सम्पर्क करने के लिए विवरण देखें');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','hindi','srp.title.Articles','ये लेख आपके लिये दिलचस्प हो सकता है');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','hindi','srp.title.cardPhoneNumber','${locality},${cityName} में ${name},${category} के संपर्क के लिए फोन नंबर');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','hindi','srp.title.compareResults','प्रमुख परिणामों की तुलना');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','hindi','srp.title.Events','कार्यक्रम');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','hindi','srp.title.inAndNear','${where},${cityName} में और निकटत्तम् ${what}');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','hindi','srp.title.Movies','फिल्म');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','hindi','srp.title.topSearch','प्रमुख खोजें');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','hindi','srp.tooltip.HeadOffice','मुख्य कार्यालय');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','hindi','srp.tootltip.Services','सेवाएँ');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','english','footer.title.advertise','Advertise with asklaila');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','english','footer.title.Android','AskLaila StreetSmart Local Search Mobile App on Andoid');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','english','footer.title.blog','Asklaila Blogs');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','english','footer.title.brandLocator','Brand Locator');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','english','footer.title.CityGuide','CITY GUIDE');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','english','footer.title.cityScape','CityScape');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','english','footer.title.contactUs','Contact Us');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','english','footer.title.corporate','CORPORATE');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','english','footer.title.FAQ','Frequently Asked Questions');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','english','footer.title.iOS','AskLaila StreetSmart Local Search Mobile App on iOS');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','english','footer.title.localityGuide','${cityName} Locality Guide');
INSERT INTO cafe.bhasha_templates( `module`, `language`, `key`, `value`) VALUES ('CAFE','english','footer.title.Mobile','MOBILE');
I have made sure that my DB table is also in COLLATION_NAME: utf8_general_ci and so are the columns.
But when I view the same in my application i can see text as :
शहर का मारà¥à¤—दरà¥à¤¶à¤•
Bangalore मारà¥à¤—दरà¥à¤¶à¤•
Bangalore सà¥à¤¥à¤¾à¤¨à¥€à¤¯ मारà¥à¤—दरà¥à¤¶à¤•
बà¥à¤°à¤¾à¤‚ड लोकेटर
लोकपà¥à¤°à¤¿à¤¯ पà¥à¤°à¤¶à¥à¤
I have rechecked that my encoding does not have latin1 anywhere but I am still unable to figure out why it is happening.I suspect it may have something to do with inserting using UNIX.
The same code in my local DB and application wherein im using SQLYog insert is working fine. But in my prod DB it is coming messed.
Please advice.
¨