No idea if this also fixes saving in emscripten... but is possible
Should fix saving when the encoding was specified in the INI (why was this never noticed) (fixes EasyRPG/Player#465).
dst_enc wasn't converted to the proper names ICU/iconv expect
It does not work for me with Don's adventures with existing Encoding=1251, after building and installing ghabry-liblcf:development and rebuilding a clean player linked with it they are being saved corrupted yet.
Accept ambiguous encoding for dst_enc. The former only fixed the case…
… when --encoding is passed via commandline.
Saving was totally broken when passed via "--encoding", because it will just use the original value, e.g. "1252" which is invalid to ICU/iconv.
This got fixed by passing dst_enc to CodepageToEncoding.
The same bug wasn't visible for the ini-case, because GetEncoding called CodepageToEncoding already. So saving worked for encoding that have a specific hardcoded mapping (932 and 949 have these), like Japanese, but Russian just got windows-1252, which is ambigious. Ambigious was already accepted for the src, but not for the dst case.
To sum up: When you had a russian game and it was NOT autodetected, then saving failed.