Big5

The page is encoded in Big5 but could be encoded in another charset such as UTF-8 as well.
The sgf file is encoded in Big5 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 "mgos-loc-zh-tw.js" (for traditionnal chinese).

maxigos-comment.js

Load the maxiGos script "maxigos-comment.js".
Read the sgf file "Mingren-001-1F-1-zh-tw.sgf" (game information in traditionnal chinese).

Setp 1: maxiGos reads the sgf file, looks at its CA property and sees that it is Big5.
Step 2: maxiGos transforms the sgf file content from Big5 to UTF-8.
Step 3: the browser detects that the page is in Big5 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 Big5.
Step 5: maxiGos displays its labels in traditionnal chinese (using mgos-loc-zh-tw.js code).

maxigos-edit.js

Load the maxiGos script "maxigos-edit.js".
Read the sgf file "Mingren-001-1F-1-zh-tw.sgf" (game information in traditionnal chinese).

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 "Big5" because we set the value of the "toCharset" parameter to "Big5" using data-maxigos-to-charset="Big5" as attribute of the script tag that loads the player. Another method could be to add in the code of the player mxG.D[mxG.K].toCharset="Big5"; just before mxG.D[mxG.K].createAll();.

Setp 1: maxiGos reads the sgf file, looks at its CA property and sees that it is Big5.
Step 2: maxiGos transforms the sgf file content from Big5 to UTF-8.
Step 3: the browser detects that the page is in Big5 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 Big5.
Step 5: maxiGos displays its labels in traditionnal chinese (using mgos-loc-zh-tw.js code).
Step 6: if the user clicks on the "Sgf" button, maxiGos looks at the value of the "toCharset" parameter and sees that it is "Big5" and not "UTF-8".
Step 7: maxiGos replaces the CA property of the sgf by "Big5" then displays the sgf.