This page is encoded in Shift_JIS but could be encoded in another charset such as UTF-8 as well.
The sgf file is encoded in Shift_JIS but could be encoded in another charset such as UTF-8 as well.
The sgf file must be encoded in the charset specified in its CA property (the most important).
The maxiGos js scripts themselves are encoded in UTF-8 (no good reason to change this).
Because the page is not in UTF-8, the key point is to use charset="UTF-8" in the script tags that load the js scripts (<script charset="UTF-8" src="...">).
Start by loading the localization script "maxigos-i18n-ja.js" (for japanese).
Use "comment.php" script.
Read the sgf file "Mingren-001-1F-1-ja-Shift_JIS.sgf" (in this file, CA is Shift_JIS and game information is in japanese).
Setp 1: maxiGos reads the sgf file, looks at its CA property and sees that it is Shift_JIS.
Step 2: maxiGos transforms the sgf file content from Shift_JIS to UTF-8.
Step 3: the browser detects that the page is in Shift_JIS and the script tags have charset="UTF-8".
Step 4: the browser transforms maxiGos output (strings that are displayed on the screen) from UTF-8 to Shift_JIS.
Step 5: maxiGos displays its labels in japanese (using maxigos-i18n-ja.js script).
Use "edit.php" script.
Read the sgf file "Mingren-001-1F-1-ja-Shift_JIS.sgf" (in this file, CA is Shift_JIS and game information is in japanese).
By default, maxiGos generates sgf in "UTF-8". But here, when the user clicks on the "Sgf" button or selects the "Save" menu, the charset in the CA property of the sgf is "Shift_JIS" because we set the value of the "toCharset" parameter to "Shift_JIS" using data-maxigos-to-charset="Shift_JIS" as attribute of the script tag that loads the player.
Setp 1: maxiGos reads the sgf file, looks at its CA property and sees that it is Shift_JIS.
Step 2: maxiGos transforms the sgf file content from Shift_JIS to UTF-8.
Step 3: the browser detects that the page is in Shift_JIS and the script tags have charset="UTF-8".
Step 4: the browser transforms maxiGos output (strings that are displayed on the screen) from UTF-8 to Shift_JIS.
Step 5: maxiGos displays its labels in japanese (using maxigos-i18n-ja.js script).
Step 6: if the user clicks on the "Sgf" button, maxiGos looks at the value of the "toCharset"
parameter and sees that it is "Shift_JIS" and not "UTF-8".
Step 7: maxiGos replaces the CA property of the sgf by "Shift_JIS" then displays the sgf.