code_field icon indicating copy to clipboard operation
code_field copied to clipboard

[Severe] ***ALL*** non-ASCII codes cause `string is not well-formed UTF-16` errors

Open TekExplorer opened this issue 2 years ago • 3 comments

If emojis were in a document and loaded into the editor, it results in Invalid argument(s): string is not well-formed UTF-16

Is there some way to fix this and actually render these emojis?

TekExplorer avatar Jun 07 '22 22:06 TekExplorer

@BertrandBev This is a serious issue with this package - attempting to load (or even just type) emojis will cause a malformed utf16 error due to... something in your code.

The stacktrace is completely unhelpful too.

TekExplorer avatar Nov 05 '23 20:11 TekExplorer

CORRECTION! attempting to input a Japanese character (as an example) has the same exact issue. what the actual hell

TekExplorer avatar Nov 05 '23 20:11 TekExplorer

Did you end up finding a fix?

BertrandBev avatar Feb 06 '24 14:02 BertrandBev

@BertrandBev

Did you end up finding a fix?

My fix was switching to flutter_code_editor which has its own issues, but at least i can use all characters properly now... attempting to find the issue was impossible for me since i had no way of knowing how to trace it down.

perhaps compare both packages and see where the difference lies? i dont know

TekExplorer avatar Apr 15 '24 06:04 TekExplorer

@TekExplorer @BertrandBev https://github.com/BertrandBev/code_field/pull/97/files This should fix it.

Note: I have this forked and on another repo, but made this patch via GitHubs web-based tooling, so you may want to pull down and test prior to merging.

I believe this was the fix for me when experiencing this issue 👍🏼

mack-at-pieces avatar Apr 15 '24 21:04 mack-at-pieces