logoalt Hacker News

ivanjermakov • yesterday at 11:53 PM • 1 reply • view on HN

What's wrong with UTF-16 for transport?


Replies

hmry • today at 7:43 AM

In LSP, UTF-16 is not just for transport. Source locations are also referred to by their UTF-16 offset. That means applications are required to store a persistent mapping from UTF-16 offsets to whatever they use internally, keep that mapping updated as the document is edited, and map back and forth constantly.

Oh well. It was primarily designed to be a good protocol for VSCode, not for any other users. That's just the price you pay when using a corporate standard.

➕ show 1 reply