parro-it/libui-node

TextArea.getText() line ending discrepancy on Windows

mischnic opened this issue · 5 comments

bildschirmfoto 2018-04-28 um 22 14 48
(from here: #84 (comment))

I think we could solve the issue by replacing newlines in setText

It's also interesting that textarea.getText() returns the text with "\n" (also on windows), but setText() requires the platform specific type.

@andlabs Is this the intended behavior?

That means there is a bug in utf16.cpp CRLFtoLF(). Will investigate later; please file this on libui.

And yes, that is the intended behavior; it needs to be documented. The Windows EDIT control requires CRLF line endings.

The bug was discovered by @mimecorg and should be already fixed now in libui master

Works correctly now. Removed workaround in example in 053769f.