Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoding issues #65

Open
apexatoll opened this issue Jun 15, 2021 · 1 comment
Open

Encoding issues #65

apexatoll opened this issue Jun 15, 2021 · 1 comment

Comments

@apexatoll
Copy link

apexatoll commented Jun 15, 2021

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

@shugo
Copy link
Member

shugo commented Jan 19, 2022

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants