Pocket Plane Group
BG1 Completed Mods => Tutu Mods and Modding => Topic started by: agb1 on January 19, 2016, 08:44:28 AM
-
I noticed this recently in a user's install log:
Setup-XanBG1Friend.exe --no-exit-pause --noautoupdate --language 0 --skip-at-view --quick-log --force-install-list 0 --logapp
[Setup-XanBG1Friend.exe] WeiDU version 23800
Using Language [English]
Using .\lang\en_us/dialog.tlk
Installing [Xan's friendship path for BG1] [v9bgee]
Windows conversion with CP1252
'bg1npc\iconv' is not recognized as an internal or external command,
operable program or batch file.
Copying 1 file ...
loading 1 tra file
The conv_tra.bat script in xanbg1friend folder references bg1npc\iconv instead of xanbg1friend\iconv:
:: Use a parameter to the script (%1) to specify the directory that must be converted
:: Use a parameter to the script (%2) to specify the encoding of the files to convert
:: Prevent display of DOS command lines
@echo off
if not exist xanbg1friend\%1\utf8 mkdir xanbg1friend\%1\utf8
:: Since the pattern matching in Windows considers that "fu.tra_utf8" also matches "*.tra", we have to
:: handle the file extension by ourselfves in order to avoid all those tra_utf8_utf8 etc files
:: Use %%~ni instead of %%~nxi (x is for extension) and specify the tra extension
for %%i in (xanbg1friend\%1\*.tra) do bg1npc\iconv -f %2 -t UTF-8 "xanbg1friend\%1\%%~ni.tra" > "xanbg1friend\%1\utf8\%%~ni.tra"
Rather than just fixing that script, I suggest switching to use the newer HANDLE_CHARSETS method, which would allow you to remove conv_tra.bat and conv_tra.sh. Just replace the current ALWAYS block in xanbg1friend.tp2 with this:
ALWAYS
ACTION_DEFINE_ASSOCIATIVE_ARRAY tra#charsets BEGIN
"English" => "CP1252"
"Russian" => "CP1251"
"German" => "CP1252"
"French" => "CP1252"
"Italian" => "CP1252"
END
ACTION_DEFINE_ARRAY tra#reload BEGIN O#XanBG1 END
LAF HANDLE_CHARSETS
STR_VAR
charset_table = tra#charsets
tra_path = EVAL ~%MOD_FOLDER%~
iconv_path. = EVAL ~%MOD_FOLDER%~
reload_array = tra#reload
END
END
Edited to use original charsets table imstead of infer_charsets, just in case.
-
I put up a local v10 with:
// Setup
BACKUP ~XanBG1Friend/Backup~
AUTHOR ~Kulyok http://forums.pocketplane.net~
VERSION ~v10~ /* Thanks to Isaya for changes for v9 for BGEE; Kaeloree did the rest, BGEE-wise */
README ~XanBG1Friend/Readme-XanBG1Friend.txt~
// BG:EE TRA compatibility
ALWAYS
ACTION_DEFINE_ASSOCIATIVE_ARRAY tra#charsets BEGIN
"English" => "CP1252"
"Russian" => "CP1251"
"German" => "CP1252"
"French" => "CP1252"
"Italian" => "CP1252"
END
ACTION_DEFINE_ARRAY tra#reload BEGIN O#XanBG1 END
LAF HANDLE_CHARSETS
STR_VAR
charset_table = tra#charsets
tra_path = EVAL ~%MOD_FOLDER%~
iconv_path. = EVAL ~%MOD_FOLDER%~
reload_array = tra#reload
END
END
// Languages
AUTO_TRA ~XanBG1Friend/%s~
LANGUAGE ~English~ ~English~ ~XanBG1Friend/English/O#XanBG1.tra~
LANGUAGE ~Russian~ ~Russian~ ~XanBG1Friend/Russian/O#XanBG1.tra~
LANGUAGE ~German (Translated by Steffen)~ ~German~ ~XanBG1Friend/German/O#XanBG1.tra~
LANGUAGE ~French (Translated by Eleima)~ ~French~ ~XanBG1Friend/French/O#XanBG1.tra~
LANGUAGE ~Italian (Translated by totuccio5)~ ~Italian~ ~XanBG1Friend/Italian/O#XanBG1.tra~
// Component
BEGIN ~Xan's friendship path for BG1~
which gives me the error message "FAILURE:
ERROR: no tabulated charset could be found for language english".
I have no experience with ACTION_DEFINE_ASSOCIATIVE_ARRAY, can someone point me to the problem?
-
OK, new question: Is it correct that
ACTION_DEFINE_ARRAY fl#reload BEGIN O#XanBG1 END
LAF HANDLE_CHARSETS
INT_VAR
infer_charset = 1
STR_VAR
tra_path = EVAL ~%MOD_FOLDER%~
reload_array = fl#reload
END
handles the languages in question (English, Russian, German, French, Italian) correctly?
-
The WeiDU readme lists the language names that HANDLE_CHARSETS handles by defaut. Those names are in the list, so it should associate the right character encoding for them. Providing the table is only necessary if an unlisted language is concerned or if a mod uses an unusual language name for one language.
Provided the iconv binary for Windows is located in %MOD_FOLDER%/iconv directory (%tra_path%/iconv is the default location if you don't specify iconv_path, as written in the readme), the second code should work.
So, compared to v9, you need to move iconv.exe and the dll in an iconv subdirectory.
If you don't move iconv.exe from its location in v9, you need to add iconv_path = EVAL ~%MOD_FOLDER%~
Thank you for taking the time to fix this mistake I made years ago. I made a similar change locally but never posted it and probably never tested it either.
-
Thank you!
-
There is a v10 with repaired EE compatibility (for all language versions) here (http://forums.pocketplane.net/index.php/topic,29650.0.html).