Discussion about special characters in Portable Text to HTML conversion
Yes, @portabletext/to-html (and the older @sanity/block-content-to-html) fully support special characters like Ă, á, ñ, and other Unicode characters. The issue you're experiencing isn't with Portable Text itself, but rather with how your HTML is being rendered.
Based on a community discussion about this exact issue, the problem is typically a character encoding mismatch between how Sanity stores the content (UTF-8) and how your browser interprets it.
The Solution
The most common fix is to ensure your HTML page is explicitly set to use UTF-8 encoding. Add this meta tag to your HTML's <head> section:
<meta charset="UTF-8" />If you're seeing characters like "á" instead of "á", or "Ă" displaying incorrectly, this is a classic sign that UTF-8 encoded content is being interpreted as Windows-1252 or another encoding.
Why This Works
Sanity's API serves all content with UTF-8 encoding (Content-Type: application/json;charset=utf-8). UTF-8 can encode every character in Unicode, including all the special characters you need. When your HTML doesn't declare its encoding, browsers may guess incorrectly, causing the garbled text you're seeing.
Additional Options
If adding the meta tag doesn't work (though it should), you can also configure your web server to send the proper HTTP header:
Content-Type: text/html;charset=utf-8
The exact method depends on your hosting setup, but the meta tag solution typically works for most cases.
This issue affects both the old @sanity/block-content-to-html package and the newer @portabletext/to-html, so the fix will work regardless of which version you're using. The encoding issue is on the rendering side, not with Portable Text's handling of the characters themselves - Portable Text stores and processes all Unicode characters correctly by default.
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.