Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: eri0o on Wed 21/08/2024 20:01:30

Title: [Solved] Is there a way to know the game encoding from plugin API?
Post by: eri0o on Wed 21/08/2024 20:01:30
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!
Title: Re: Is there a way to know the game encoding from plugin API?
Post by: Crimson Wizard on Wed 21/08/2024 22:10:21
If by "game encoding" you mean the current text encoding mode, that may be received by

Code (ags) Select
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.
Title: Re: Is there a way to know the game encoding from plugin API?
Post by: eri0o on Thu 22/08/2024 00:01:43
Thank you! I will use that! :)