encode string of bytes not list of chars

This commit is contained in:
Khudyakov Alexey 2010-06-13 11:33:41 +00:00
parent c6178cacd2
commit e708caf2ac

View File

@ -56,7 +56,7 @@ module XMonad.Actions.Search ( -- * Usage
-- $tip -- $tip
) where ) where
import Codec.Binary.UTF8.String (encodeString) import Codec.Binary.UTF8.String (encode)
import Data.Char (isAlphaNum, isAscii) import Data.Char (isAlphaNum, isAscii)
import Data.List (isPrefixOf) import Data.List (isPrefixOf)
import Text.Printf import Text.Printf
@ -208,7 +208,7 @@ escape = concatMap escapeURIChar
escapeURIChar :: Char -> String escapeURIChar :: Char -> String
escapeURIChar c | isAscii c && isAlphaNum c = [c] escapeURIChar c | isAscii c && isAlphaNum c = [c]
| otherwise = concatMap (printf "%%%02X") $ encodeString [c] | otherwise = concatMap (printf "%%%02X") $ encode [c]
type Browser = FilePath type Browser = FilePath
type Query = String type Query = String