-
Notifications
You must be signed in to change notification settings - Fork 34
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
does not render non-US-ASCII charcters #6
Comments
Works for me (ruby 2.1.0, linux). What's your platform? |
On OSX curses appears to support only the basic multilingual plane so you can't print emoji, for example. It's also limited by your terminal's ability to perform glyph substitution. I have used curses to display non-ASCII characters so a failing example and environment information will be needed. |
The platform I use is the Ruby version is I installed the gem using 'gem install curses', it installed I edited the "hello.rb" example, added three accented characters, checked require "curses" def show_message(message) init_screen show_message("Hit any key")setpos((lines - 5) / 2, (cols - 10) / 2) On Sun, Aug 3, 2014 at 9:37 PM, Eric Hodel notifications@github.com wrote:
|
Try adding the line below to the top of your ruby file: |
It won't help (I used Ruby 2.1 which defaults to UTF-8). |
if puts "Hello, World! éàù" works in your terminal then you may need to take a look at your implementation of curses. The gem simply binds to a unix .so file. |
The output from "puts" is fine, but curses is not... I replaced the 'curses.so' file with other versions I had on my system and one of the fixed the problem. The version that fixes the problem comes from a Ruby 2.0.0 (not the one from the gem) and is also a x86_64-linux. |
That's good news. |
Same problem with Ruby 2.1.5 and Debian 8. I tried installing Ruby 2.0.0 with RVM and it fixed it. If possible I would like to find a better solution as I'm not a Ruby dev and I don't need two installs of Ruby nor RVM. |
Yes, I am using rvm. I copied the file installed on my system at To my rvm gemset (named curses)
|
Same problem with Ruby 2.2.0 and Debian 8. I installed libncursesw5-dev, which adds /. which does not allow curses gem to compile. I think extconf.rb has to be adapted. |
Solution would be: ext/curses/curses.c - line 25 - add:
ext/curses/extconf.rb - line 35 - add
|
anybody alive? I know fixing build problems is boring, but this would actually be very helpful for linux users that want curses + utf-8 (by using ncursesw). |
You may want to check out https://github.com/eclubb/ncurses-ruby and see if it fixes your problems. I'm not a maintainer of this project. Just a listener. |
@mcormier: nope. has same problem, plus has very different api. |
the question is: is this issue tracker actually for issue tracking, or do we have to go through https://bugs.ruby-lang.org/? |
It's possible this is a bug with your terminal or the version of ncurses you're using. |
@zzak: i already explained that in linux now curses with wide character support typically comes in ncursesw package, which is inlcuded through ncursesw/curses.h. I also explained the 2 small changes in order to fix it. So i'm fine :-) I just wonder if this is maintained at all. |
OH I see! Sorry I missed your comment.. could you send a patch? <3 |
Released as curses 1.0.2 |
Sorry to reopen this, but I'm getting the same problem (non-ASCII char not printed properly) with curses 1.2.7. Ubuntu 18, en_US.UTF-8 terminal. |
If the code displays non-US-ASCII characters they do not appear as expected.
Add some accents to the
sample/hello.rb
example, likeThe message is displayed as:
The text was updated successfully, but these errors were encountered: