[Solved] Is there a way to know the game encoding from plugin API?

Started by eri0o, Wed 21/08/2024 20:01:30

Previous topic - Next topic

eri0o

OK, I am almost adding this as a feature in the plugin API, but before doing so I am curious if perhaps there is already a way to read it somehow.

I need to figure the encoding of a string I am receiving from the engine in a plugin.

Is there some way to do it in the 3.6.1 version of the engine? Thanks!

Crimson Wizard

#1
If by "game encoding" you mean the current text encoding mode, that may be received by

Code: ags
GetGameOption(OPT_GAMETEXTENCODING)

https://adventuregamestudio.github.io/ags-manual/Globalfunctions_General.html#getgameoption

Note that this value will change whenever a translation loads, if translation has a different encoding.

EDIT:

there's also IAGSEngine.GetGameOptions, but it returns a raw pointer to engine memory, and thus this function is deprecated in AGS 4.

eri0o


SMF spam blocked by CleanTalk