Jump to content

Haskell runCommand

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
asafe

asafe

    Programmer

  • Members
  • PipPipPipPip
  • 107 posts
Consider the following snippet:
module Main where
import System
import System.Process
import Control.Monad

main :: IO ()
main = do
  putStrLn "Running command..."
  pid <- runCommand "/home/asafe/slide.sh 15" 
  replicateM_ 10 $ putStrLn "Doing other stuff"
  waitForProcess pid >>= exitWith

It works fine. But if the string passed to runCommand contains any non english letter(such as ç, á), the script fails. Any ideas?

#2
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,721 posts
I don't speak Haskell, but I've found a bit of stuff on the Internet. Hope it helps...Look at the very bottom for a code snippet here.
sudo rm -rf /

#3
asafe

asafe

    Programmer

  • Members
  • PipPipPipPip
  • 107 posts
It does not work. ú, e.g., becomes \250 and then a unrecognizable symbol.
By the way all the gtk2hs handle strings like that, I'm having problems with fileChooser too.

#4
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,721 posts
Ok, then I'm no longer useful. Sorry, man.
sudo rm -rf /