mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
GFServer.hs: apply UTF8 encoding when saving uploaded files
This fixes a bug introduced on May 16.
This commit is contained in:
@@ -180,8 +180,7 @@ handle state0 cache execute1
|
|||||||
return (state,json200 (jsonresult cwd ('/':dir++"/") cmd out files))
|
return (state,json200 (jsonresult cwd ('/':dir++"/") cmd out files))
|
||||||
|
|
||||||
upload files =
|
upload files =
|
||||||
do let update (name,contents)= updateFile name contents
|
do mapM_ (uncurry updateFile) files
|
||||||
mapM_ update files
|
|
||||||
return (state,resp204)
|
return (state,resp204)
|
||||||
|
|
||||||
jsonList =
|
jsonList =
|
||||||
@@ -354,8 +353,9 @@ contentTypeFromExt ext =
|
|||||||
bin t = (t,readBinaryFile)
|
bin t = (t,readBinaryFile)
|
||||||
|
|
||||||
-- * IO utilities
|
-- * IO utilities
|
||||||
updateFile path new =
|
updateFile path new0 =
|
||||||
do old <- try $ readBinaryFile path
|
do old <- try $ readBinaryFile path
|
||||||
|
let new = encodeString new0
|
||||||
when (Right new/=old) $ do logPutStrLn $ "Updating "++path
|
when (Right new/=old) $ do logPutStrLn $ "Updating "++path
|
||||||
seq (either (const 0) length old) $
|
seq (either (const 0) length old) $
|
||||||
writeBinaryFile path new
|
writeBinaryFile path new
|
||||||
|
|||||||
@@ -40,7 +40,3 @@
|
|||||||
|
|
||||||
+ Bug! The startcat menu shows the first category by default, but the startcat
|
+ Bug! The startcat menu shows the first category by default, but the startcat
|
||||||
flag is actually not set until a selection is made from the menu.
|
flag is actually not set until a selection is made from the menu.
|
||||||
|
|
||||||
- Bug! In Opera it seems that grammars are sent with the wrong character
|
|
||||||
encoding to the server, preventing grammars containing ÅÄÖ or other non-ASCII
|
|
||||||
characters from working.
|
|
||||||
|
|||||||
Reference in New Issue
Block a user