summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2018-08-14 17:50:51 -0400
committerJoey Hess2018-08-14 17:50:51 -0400
commit0b09aff1bc5715afbbb9b3d70c6f2021979b41de (patch)
treeabf4915bd05d6cbdc60dadcecf52165453d3c385
parentc09e4246ce3b497d1ff0ac87060073cc1b96eba9 (diff)
response
-rw-r--r--doc/forum/Privdata_corrupted_when_spinning_from_macOS/comment_1_0443c1dc8f7a74864c2a981740992ee4._comment27
1 files changed, 27 insertions, 0 deletions
diff --git a/doc/forum/Privdata_corrupted_when_spinning_from_macOS/comment_1_0443c1dc8f7a74864c2a981740992ee4._comment b/doc/forum/Privdata_corrupted_when_spinning_from_macOS/comment_1_0443c1dc8f7a74864c2a981740992ee4._comment
new file mode 100644
index 00000000..3b047d9d
--- /dev/null
+++ b/doc/forum/Privdata_corrupted_when_spinning_from_macOS/comment_1_0443c1dc8f7a74864c2a981740992ee4._comment
@@ -0,0 +1,27 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2018-08-14T21:33:55Z"
+ content="""
+Sounds like a problem with sendPrivData, which writes it to a Handle that's
+connected to propellor on the host being spun.
+
+Handles have an associated encoding, which comes from the locale settings.
+The char8 TextEncoding sounds like what you describe (code point modulo
+256). hSetEncoding can change it.
+
+Here's a patch you could try that prints out the encoding in use and tries
+to force utf8.
+
+ --- a/src/Propellor/Spin.hs
+ +++ b/src/Propellor/Spin.hs
+ @@ -252,6 +252,8 @@ sendRepoUrl hst toh = sendMarked toh repoUrlMarker =<< geturl
+
+ sendPrivData :: HostName -> Handle -> PrivMap -> IO ()
+ sendPrivData hn toh privdata = void $ actionMessage msg $ do
+ + hPutStrLn stderr . show =<< hGetEncoding toh
+ + hSetEncoding toh utf8
+ sendMarked toh privDataMarker d
+ return True
+ where
+"""]]