If this setting is not made, Japanese will not be displayed correctly and will be ????.
Maybe there is an Iloilo method even if you don't do it each time ... I would appreciate it if you could teach me.
We refer to the following qiita as a whole. Thank you very much. https://qiita.com/maejima_f/items/4d5432aa471a9deaea7f
$ docker exec -it container name bash
Check the locale settings in the container
root@XXXX :/# locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
It starts from changing the information of this locale to Japan and UTF-8. Before that, update the inside of the container or put vim and prepare.
root@XXXX :/# apt-get update
root@XXXX :/# apt-get install vim
After doing the two, make the following settings.
root@XXXX :/# dpkg-reconfigure locales
-------------------
Locales are a framework to switch between multiple languages and allow users to use their language, country, characters, collation
order, etc.
Please choose which locales to generate. UTF-8 locales should be chosen by default, particularly for new installations. Other
character sets may be useful for backwards compatibility with older systems and software.
1. All locales 125. el_GR ISO-8859-7 249. gl_ES ISO-8859-1 373. pl_PL ISO-8859-2
2. aa_DJ ISO-8859-1 126. el_GR.UTF-8 UTF-8 250. gl_ES.UTF-8 UTF-8 374. pl_PL.UTF-8 UTF-8
3. aa_DJ.UTF-8 UTF-8 127. el_GR@euro ISO-8859-7 251. gl_ES@euro ISO-8859-15 375. ps_AF UTF-8
4. aa_ER UTF-8 128. en_AG UTF-8 252. gu_IN UTF-8 376. pt_BR ISO-8859-1
5. aa_ER@saaho UTF-8 129. en_AU ISO-8859-1 253. gv_GB ISO-8859-1 377. pt_BR.UTF-8 UTF-8
6. aa_ET UTF-8 130. en_AU.UTF-8 UTF-8 254. gv_GB.UTF-8 UTF-8 378. pt_PT ISO-8859-1
7. af_ZA ISO-8859-1 131. en_BW ISO-8859-1 255. ha_NG UTF-8 379. pt_PT.UTF-8 UTF-8
8. af_ZA.UTF-8 UTF-8 132. en_BW.UTF-8 UTF-8 256. hak_TW UTF-8 380. pt_PT@euro ISO-8859-15
9. agr_PE UTF-8 133. en_CA ISO-8859-1 257. he_IL ISO-8859-8 381. quz_PE UTF-8
10. ak_GH UTF-8 134. en_CA.UTF-8 UTF-8 258. he_IL.UTF-8 UTF-8 382. raj_IN UTF-8
11. am_ET UTF-8 135. en_DK ISO-8859-1 259. hi_IN UTF-8 383. ro_RO ISO-8859-2
12. an_ES ISO-8859-15 136. en_DK.ISO-8859-15 ISO-8859-15 260. hif_FJ UTF-8 384. ro_RO.UTF-8 UTF-8
13. an_ES.UTF-8 UTF-8 137. en_DK.UTF-8 UTF-8 261. hne_IN UTF-8 385. ru_RU ISO-8859-5
[More]
(Omitted)
(Enter the items you want to select, separated by spaces.)
Locales to be generated: 285 #This is the current Japanese UTF-It is a setting number of 8.
root@XXXX :/# dpkg-reconfigure tzdata
------------------
Please select the geographic area in which you live. Subsequent configuration questions will narrow this down by presenting a list of
cities, representing the time zones in which they are located.
1. Africa 3. Antarctica 5. Arctic 7. Atlantic 9. Indian 11. SystemV 13. Etc
2. America 4. Australia 6. Asia 8. Europe 10. Pacific 12. US
Geographic area: 6 #Select Asia
Please select the city or region corresponding to your time zone.
1. Aden 14. Beirut 27. Gaza 40. Karachi 53. Muscat 66. Riyadh 79. Tokyo
2. Almaty 15. Bishkek 28. Harbin 41. Kashgar 54. Nicosia 67. Sakhalin 80. Tomsk
3. Amman 16. Brunei 29. Hebron 42. Kathmandu 55. Novokuznetsk 68. Samarkand 81. Ujung_Pandang
4. Anadyr 17. Chita 30. Ho_Chi_Minh 43. Khandyga 56. Novosibirsk 69. Seoul 82. Ulaanbaatar
5. Aqtau 18. Choibalsan 31. Hong_Kong 44. Kolkata 57. Omsk 70. Shanghai 83. Urumqi
6. Aqtobe 19. Chongqing 32. Hovd 45. Krasnoyarsk 58. Oral 71. Singapore 84. Ust-Nera
7. Ashgabat 20. Colombo 33. Irkutsk 46. Kuala_Lumpur 59. Phnom_Penh 72. Srednekolymsk 85. Vientiane
8. Atyrau 21. Damascus 34. Istanbul 47. Kuching 60. Pontianak 73. Taipei 86. Vladivostok
9. Baghdad 22. Dhaka 35. Jakarta 48. Kuwait 61. Pyongyang 74. Tashkent 87. Yakutsk
10. Bahrain 23. Dili 36. Jayapura 49. Macau 62. Qatar 75. Tbilisi 88. Yangon
11. Baku 24. Dubai 37. Jerusalem 50. Magadan 63. Qostanay 76. Tehran 89. Yekaterinburg
12. Bangkok 25. Dushanbe 38. Kabul 51. Makassar 64. Qyzylorda 77. Tel_Aviv 90. Yerevan
13. Barnaul 26. Famagusta 39. Kamchatka 52. Manila 65. Rangoon 78. Thimphu
Time zone: 79 #Select Tokyo
Set the environment variable LANG Edit .bashrc with the vim you just installed and Add export ...
How to edit with vim
vim ~ / .bashrc starts vim.
Use the four-way controller to move to the bottom of the file and press "i" to enter input mode
Add export ~ and press esc to return to command mode
Type: wq to save your changes
root@XXXX :/# export LANG=ja_JP.UTF-8
root@XXXX :/# vim ~/.bashrc
Looking at the locale again
root@XXXX :/# locale
LANG=ja_JP.UTF-8
LANGUAGE=
LC_CTYPE="ja_JP.UTF-8"
LC_NUMERIC="ja_JP.UTF-8"
LC_TIME="ja_JP.UTF-8"
LC_COLLATE="ja_JP.UTF-8"
LC_MONETARY="ja_JP.UTF-8"
LC_MESSAGES="ja_JP.UTF-8"
LC_PAPER="ja_JP.UTF-8"
LC_NAME="ja_JP.UTF-8"
LC_ADDRESS="ja_JP.UTF-8"
LC_TELEPHONE="ja_JP.UTF-8"
LC_MEASUREMENT="ja_JP.UTF-8"
LC_IDENTIFICATION="ja_JP.UTF-8"
LC_ALL=
It has been changed!
Plus, let's create a file called .inputrc and add its contents.
root@XXXX :/# vim ~/.inputrc
#The following 3 lines.Add to inputrc
set convert-meta off
set meta-flag on
set output-meta on
#Apply
root@XXXX :/# source ~/.inputrc
If you do the following, I think that the settings in mysql have also changed. that's all.
Recommended Posts