Set-output Truncates Multiline Strings

I have worked out a generic solution which should allow you do expose any output to a github-script via ::set-output no matter what special characters it contains: