URI encoding in the svg function results in a broken data URI
The svg helper function calls encodeURIComponent on the provided SVG before returning it. Based on the comment above the return line, that appears to be intentional as a fix for some different issue. Encoding the data like this completely breaks the data URI, resulting in a missing image placeholder on both Shreddit and the Android app (iOS untested).
https://github.com/reddit/devvit/blob/1ac06fd996891a7babb06a50d5d6ed5e039d43d7/packages/public-api/src/apis/ui/helpers/svg.ts#L51-L53
If the point of the URI encoding is to avoid issues with special characters, perhaps it would be best to instead encode it as a base64 string? From testing with local modifications, changing the return line to this appears to work as far as the SVG actually showing up is concerned:
return `data:image/svg+xml;base64,${Buffer.from(str).toString('base64')}`;