Explorar o código

Allow the server to send correct Unicode to Chrome.

Ryszard Szopa %!s(int64=14) %!d(string=hai) anos
pai
achega
0cd3ab5f92
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      edit-server.el

+ 4 - 2
edit-server.el

@@ -363,9 +363,11 @@ and its buffer are killed with `edit-server-kill-client'."
 				(process-send-string proc response-header)
 				(process-send-string proc "\n")
 				(cond
-				 ((stringp body) (process-send-string proc body))
+				 ((stringp body) (process-send-string proc (encode-coding-string body 'utf-8)))
 				 ((not body) nil)
-				 (t (process-send-region proc (point-min) (point-max))))
+				 (t (progn 
+							(encode-coding-region (point-min) (point-max) 'utf-8)
+							(process-send-region proc (point-min) (point-max)))))
 				(process-send-eof proc)
 				(if close 
 						(edit-server-kill-client proc))