Prompted by
https://chdk.setepontos.com/index.php?topic=8085.msg132522#msg132522 from dmitrys, I've updated the default.lua script to work on some newer propsets.
I tried to preserve the behavior of the existing script, with the exception that the IDs/values must be defined for each language explicitly. I also changed the code page for english to be 1252 instead of 1250 as it was in the old script, since 1252 is the default for CHDK builds (and more appropriate AFAIK).
I have reservations about this being the default script at all. It's kind of convenient, but having the CHDK language potentially change when you press the shutter in alt mode for the first time seems not very user friendly, and it's highly camera dependent. This script came from CHDK-DE in the CHDK/CHDK-DE merge and hasn't been updated significantly since. I'm unclear on the history before that.
My preference would be for the default script to just print a message along the lines of
"This is the default script"
"Press SET to load a script"
"Exit alt mode to shoot"
Some background links:
Language settings in general
https://chdk.setepontos.com/index.php?topic=2761.0A previous request to add more languages, and possible alternative from srsa_4c
https://chdk.setepontos.com/index.php?topic=650.msg128471#msg128471Script behavior
Camera language - | CHDK language - | Result |
Known | Any | CHDK language changed to camera language (or unchanged if already the same) |
Unknown | Known | CHDK language unchanged |
Unknown | Unknown | CHDK language changed to default |
Known language = one of English, German, Russian. (
I may add a few more see below)
CHDK default language = English for standard autobuild, German for CHDK-DE
If the propset is not one of the defined propsets, the script now prints
"unsupported propset N" and treats the camera language as unknown.
If the propset is known, but the value is not one of the known languages, it prints
"unknown language N:M" where N is propset ID, and M is the language value and the treats the camera language as unknown.
I verified the values for propset 1 (a540),2 (d10), 5 (sx160), 6 (elph130) and 7 (g7x). I have assumed that 3 and 4 are the same as 2. The IDs are almost certainly the same, but the values might be different.
edit:
in r4809, I added definitions for all the CHDK languages. It's possible I got some of the code pages wrong, I used the following for reference
http://www.science.co.il/language/Character-sets.phphttp://scratchpad.wikia.com/wiki/Character_Encoding_Recommendation_for_LanguagesThe script uses language file name to detect and the CHDK language, which is fragile since some of them are longer than 8.3 and may be in upper or lower case. The script now attempts to account for this.
A few CHDK languages don't appear in any Canon firmware I have.