diff lisp/mule/mule-cmds.el @ 4834:b3ea9c582280

Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
author Ben Wing <ben@xemacs.org>
date Tue, 12 Jan 2010 01:38:04 -0600
parents 02b7c7189041
children 0b0241ae382f
line wrap: on
line diff
--- a/lisp/mule/mule-cmds.el	Sun Jan 10 01:06:15 2010 -0600
+++ b/lisp/mule/mule-cmds.el	Tue Jan 12 01:38:04 2010 -0600
@@ -1191,21 +1191,24 @@
 can't set the text encoding used to communicate with the OS.  To get around
 this, we use Unicode whenever available, i.e. on Windows NT always and on
 Windows 9x whenever a Unicode version of a system call is available.)"
-  (if (eq system-type 'windows-nt)
-      ;; should not apply to Cygwin, I don't think
-      'mswindows-multibyte-system-default
-    (let ((ncod (get-language-info langenv 'native-coding-system)))
-      (if (or (functionp ncod) (not (listp ncod)))
-	  (setq ncod (list ncod)))
-      (let ((native
-	     (dolist (try-native ncod)
-	       (let ((result
-		      (if (functionp try-native)
-			  (funcall try-native locale)
-			try-native)))
-		 (if result (return result))))))
-	(or native (car (get-language-info langenv 'coding-system))
-	    'raw-text)))))
+  (cond ((eq system-type 'windows-nt)
+	 ;; should not apply to Cygwin, I don't think
+	 'mswindows-multibyte-system-default)
+	((featurep 'cygwin-use-utf-8)
+	 'utf-8)
+	(t
+	 (let ((ncod (get-language-info langenv 'native-coding-system)))
+	   (if (or (functionp ncod) (not (listp ncod)))
+	       (setq ncod (list ncod)))
+	   (let ((native
+		  (dolist (try-native ncod)
+		    (let ((result
+			   (if (functionp try-native)
+			       (funcall try-native locale)
+			     try-native)))
+		      (if result (return result))))))
+	     (or native (car (get-language-info langenv 'coding-system))
+		 'raw-text))))))
 
 (defun get-coding-system-from-locale (locale)
   "Return the coding system corresponding to a locale string."