You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using py-tree-sitter in my PyQt written text editor, and since Qt's QPlainTextEdit QTextDocument using UTF-16, I was wondering if you could add UTF-16 encoding support to this Python binding. Because tree-sitter supports UTF-16 and I see in binging.c it has UTF-8 as default input. Now I have to convert Qt's string to UTF-8 and pass it to py-tree-sitter's parser, and I have to calculate the correct position and byte position from the returned value and map it to the QTextDocument's cursor position. This conversion is complex and error-prone.
#9
Open
Freebands22 opened this issue
May 8, 2024
· 0 comments
I'm using py-tree-sitter in my PyQt written text editor, and since Qt's QPlainTextEdit QTextDocument using UTF-16, I was wondering if you could add UTF-16 encoding support to this Python binding. Because tree-sitter supports UTF-16 and I see in binging.c it has UTF-8 as default input. Now I have to convert Qt's string to UTF-8 and pass it to py-tree-sitter's parser, and I have to calculate the correct position and byte position from the returned value and map it to the QTextDocument's cursor position. This conversion is complex and error-prone.
I'm using py-tree-sitter in my PyQt written text editor, and since Qt's QPlainTextEdit QTextDocument using UTF-16, I was wondering if you could add UTF-16 encoding support to this Python binding. Because tree-sitter supports UTF-16 and I see in binging.c it has UTF-8 as default input. Now I have to convert Qt's string to UTF-8 and pass it to py-tree-sitter's parser, and I have to calculate the correct position and byte position from the returned value and map it to the QTextDocument's cursor position. This conversion is complex and error-prone.
Originally posted by @CallmeNezha in tree-sitter/py-tree-sitter#204
The text was updated successfully, but these errors were encountered: