curses icon indicating copy to clipboard operation
curses copied to clipboard

Encoding issues

Open apexatoll opened this issue 4 years ago • 1 comments

I'm, currently experiencing an issue with the "inch" method in Ruby curses, this is reproducible in both curses 1.4.2 and 1.4.1. However the issue is not present in curses 1.4.0

Using win.inch.chr returns the character at the cursor position as intended, but in curses 1.4.1/2 this results in an error saying char is out of range. Manually setting the encoding to UTF_8 or UTF_16 removes the error message but does not return the character as intended

ie Curses 1.4.0 win.inch.chr expected behaviour Curses 1.4.1+ win.inch.chr error, char out of range Curses 1.4.1+ win.inch.chr(Encoding::UTF_8) returns ? block Curses 1.4.1+ win.inch.chr(Encoding::UTF_16) interferes with formatting

apexatoll avatar Jun 15 '21 13:06 apexatoll

@apexatoll

The return value inch may be OR'ed with attribute flags.

Does (win.inch & Curses::A_CHARTEXT).chr work? If it doesn't work, please show me your code.

shugo avatar Jan 19 '22 02:01 shugo