On 02/02/2011 04:38 PM, Joey Hess wrote:
John Goerzen wrote:
On 02/01/2011 09:25 PM, Joey Hess wrote:

I believe what's happening is approximatly that getArgs returns
a raw 8-bit encoded String. Then when it's output to whatever sends
it to identica, Haskell's IO layer tries to encode it as unicode.

That is probably right.  To make sure, can you try piping the data
to twidge instead of passing it on the command line and let me know
if that does the right thing on your box?  (I want to make sure my
potentially-different locale settings don't interfere)

Seems ok piped: http://identi.ca/notice/63558473


Can you try this patch?


commit 09c59c20a35ec5f8ccd71596aad68f52fbd82559
Author: John Goerzen <jgoer...@complete.org>
Date:   Sat Feb 5 13:09:38 2011 -0600

    Correct UTF-8 reading from command line

diff --git a/Commands/Update.hs b/Commands/Update.hs
index 78bf2c6..48829cc 100644
--- a/Commands/Update.hs
+++ b/Commands/Update.hs
@@ -34,6 +34,7 @@ import Network.OAuth.Http.Request
 #ifdef USE_BITLY
 import Network.Bitly (Account(..),bitlyAccount,jmpAccount,shorten)
 #endif
+import qualified Codec.Binary.UTF8.String as UTF8
 
 i = infoM "update"
 d = debugM "update"
@@ -49,7 +50,8 @@ update = simpleCmd "update" "Update your status"
              
 update_worker_wrapper x cp args =
   do d $ "Running update_worker with: " ++ show (x, args)
-     update_worker x cp args
+     update_worker x cp (newargs args)
+  where newargs (opts, status) = (opts, map UTF8.decodeString status)
 
 update_worker x cp ([("m", "")], []) =
     do d "Reading mail message"

Reply via email to