]> git.cworth.org Git - sup/commitdiff
finally apply ncurses wide-character patch from pierre baillet
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Tue, 22 Apr 2008 21:29:26 +0000 (14:29 -0700)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Tue, 22 Apr 2008 22:33:45 +0000 (15:33 -0700)
lib/sup.rb

index 910b333841c28654d2abee3d95d0b83194ad7fbc..c4d1dd5c86bd36e1153784182a60019ece0351b9 100644 (file)
@@ -6,6 +6,19 @@ require 'fileutils'
 require 'gettext'
 require 'curses'
 
+## the following magic enables wide characters when used with a ruby
+## ncurses.so that's been compiled against libncursesw. (note the w.) why
+## this works, i have no idea. much like pretty much every aspect of
+## dealing with curses.  cargo cult programming at its best.
+
+require 'dl/import'
+module LibC
+  extend DL::Importable
+  dlload "libc.so.6"
+  extern "void setlocale(int, const char *)"
+end
+LibC.setlocale(6, "")  # LC_ALL == 6
+
 class Object
   ## this is for debugging purposes because i keep calling #id on the
   ## wrong object and i want it to throw an exception