Bruno’s idea was a good one. However, it doesn’t work in this case because the YAMS snippet actually outputs a special construct containing all language variants of the content that for embeddeding in the template. Truncating this output breaks the YAMS construct, hence the gibberish.
It’s only during parsing of the template that the YAMS construct gets parsed and replaced by the correct language text.
Your best bet for getting this to work is to install PHx as a plugin that is set to run after YAMS in the plugin event order. That way, after YAMS has finished doing it’s parsing, PHx can run, evaluating its own constructs and performing the truncation you are after.
You should be able to use something like:
[*phx:input=`[*introtext*]`:limit*]
or, failing that
[*phx:input=`((yams_data:[*id*]:introtext_(yams_lang)))`:limit*]
You might find the following
documentation on getting YAMS + PHx within Ditto snippets useful.