Language setting is sometimes ignored
(see https://github.com/harfbuzz/harfbuzz/pull/4001 for some context)
It seems that Pango will ignore the language being set if the text is in a script that is not one of the scripts Pango thinks the language can be written in.
For example, Malay can be written in both Latin script as well as Arabic script (usually referred to as Jawi), but Pango will ignore Malay language when set on a text written in Arabic script.
To demonstrate this issue, Amiri font has a substitution for Malay language set in Arabic script that converts Arabic comma (،) to a Jawi-specific upside down version.
Here using hb-view
where the substitution happens:
$ hb-view Amiri-Regular.ttf "ملایو، جاوی" --language=ms
Here using pango-view
where the substitution does not happen:
$ pango-view --font="Amiri 200" --text="ملایو، جاوی" --language=ms