prettierd
prettierd copied to clipboard
malformed utf-8 characters in neovim after formatting JSON file
It seems that when i save the file, and prettierd formats it, some characters randomly become broken.
Characters are Cyrillic. Did not notice it on Latin.
if i "save" file multiple times, it is highly likely that these diamonds will grow in count(the ones that were previously randomly genereated)
I've the same issue, but it's racy and only today I was able to trace it down to prettierd (prettier does not have this issue). In my case it's also happens on large (about 500 lines, 33KB) markdown file with Russian text.
The actual symbols used to replace a single unicode char are �� (both are 0xFFFD). I suppose this happens because somewhere inside the pipe Neovim-Conform-prettierd-prettier text is split into chunks using bytes instead of Unicode runes and sometimes split happens in the middle of Unicode symbol.
Looks like this issue is a duplicate of #694
The fix is in these 2 PRs: https://github.com/mantoni/core_d.js/pull/32 and https://github.com/fsouza/prettierd/pull/917.
As it's hard to know when both will be merged and released I've published fixed versions in npm as @powerman-asdf/core_d and @powerman-asdf/prettierd.