diff --git a/Foreign/Ruby/Bindings.hsc b/Foreign/Ruby/Bindings.hsc
--- a/Foreign/Ruby/Bindings.hsc
+++ b/Foreign/Ruby/Bindings.hsc
@@ -79,9 +79,8 @@
 type RegisteredCB3 = RValue -> RValue -> RValue -> IO Int
 foreign import ccall "wrapper" mkRegisteredCB3 :: RegisteredCB3 -> IO (FunPtr RegisteredCB3)
 
-foreign import ccall "ruby_init"                 ruby_init                   :: IO ()
 foreign import ccall "ruby_finalize"             ruby_finalize               :: IO ()
-foreign import ccall "ruby_init_loadpath"        ruby_init_loadpath          :: IO ()
+foreign import ccall "ruby_initialization"       ruby_initialization         :: IO ()
 #ifdef RUBY21
 foreign import ccall "rb_str_new_cstr"           c_rb_str_new2               :: CString -> IO RValue
 foreign import ccall "rb_ary_new_capa"           rb_ary_new2                 :: CLong -> IO RValue
diff --git a/Foreign/Ruby/Helpers.hs b/Foreign/Ruby/Helpers.hs
--- a/Foreign/Ruby/Helpers.hs
+++ b/Foreign/Ruby/Helpers.hs
@@ -178,8 +178,7 @@
 
 runscript :: String -> IO (Either String ())
 runscript filename = do
-    ruby_init
-    ruby_init_loadpath
+    ruby_initialization
     status <- rb_load_protect filename 0
     if status == 0
         then ruby_finalize >> return (Right ())
diff --git a/Foreign/Ruby/Safe.hs b/Foreign/Ruby/Safe.hs
--- a/Foreign/Ruby/Safe.hs
+++ b/Foreign/Ruby/Safe.hs
@@ -138,7 +138,7 @@
 startRubyInterpreter :: IO RubyInterpreter
 startRubyInterpreter = do
     q <- newTQueueIO
-    void $ forkOS (ruby_init >> ruby_init_loadpath >> go q)
+    void $ forkOS (ruby_initialization >> go q)
     return (RubyInterpreter q)
 
 {-| This is basically :
diff --git a/cbits/shim.c b/cbits/shim.c
--- a/cbits/shim.c
+++ b/cbits/shim.c
@@ -1,4 +1,18 @@
 #include "shim.h"
+#include <ruby/encoding.h>
+
+void ruby_initialization(void) {
+	RUBY_INIT_STACK;
+	ruby_init();
+	ruby_init_loadpath();
+	VALUE encoding = rb_enc_from_encoding(rb_filesystem_encoding());
+	rb_enc_set_default_internal(encoding);
+	rb_enc_set_default_external(encoding);
+	void rb_encdb_declare(const char *name);
+	rb_encdb_declare("ASCII-8BIT");
+	rb_encdb_declare("US-ASCII");
+	rb_encdb_declare("UTF-8");
+}
 
 VALUE safeCall(VALUE args)
 {
diff --git a/cbits/shim.h b/cbits/shim.h
--- a/cbits/shim.h
+++ b/cbits/shim.h
@@ -3,6 +3,8 @@
 #include <ruby/intern.h>
 #endif
 
+void ruby_initialization(void);
+
 struct s_dispatch {
 	char * classname;
 	char * methodname;
diff --git a/hruby.cabal b/hruby.cabal
--- a/hruby.cabal
+++ b/hruby.cabal
@@ -2,7 +2,7 @@
 --  see http://haskell.org/cabal/users-guide/
 
 name:                hruby
-version:             0.3.1.2
+version:             0.3.1.3
 synopsis:            Embed a Ruby intepreter in your Haskell program !
 description:         This doesn't work with Ruby 1.9. Everything you need should be in Foreign.Ruby.Safe.
 license:             BSD3
