sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit c1109326ae9116f0c814258b310333e13b2c3730
parent 22c262ec1743d390b7154690c882d058192d799c
Author: William Morgan <wmorgan-sup@masanjin.net>
Date:   Wed, 30 Jul 2008 17:46:27 -0700

Merge commit 'origin/ncurses-widechar'

Diffstat:
M lib/sup.rb | 13 +++++++++++++
1 file changed, 13 insertions(+), 0 deletions(-)
diff --git a/lib/sup.rb b/lib/sup.rb
@@ -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 Config::CONFIG['arch'] =~ /darwin/ ? "libc.dylib" : "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