comparison 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
comparison
equal deleted inserted replaced
4833:4dd2389173fc 4834:b3ea9c582280
1189 Under MS Windows, the native coding system must be set from the default 1189 Under MS Windows, the native coding system must be set from the default
1190 system locale and is not influenced by LOCALE. (In other words, a program 1190 system locale and is not influenced by LOCALE. (In other words, a program
1191 can't set the text encoding used to communicate with the OS. To get around 1191 can't set the text encoding used to communicate with the OS. To get around
1192 this, we use Unicode whenever available, i.e. on Windows NT always and on 1192 this, we use Unicode whenever available, i.e. on Windows NT always and on
1193 Windows 9x whenever a Unicode version of a system call is available.)" 1193 Windows 9x whenever a Unicode version of a system call is available.)"
1194 (if (eq system-type 'windows-nt) 1194 (cond ((eq system-type 'windows-nt)
1195 ;; should not apply to Cygwin, I don't think 1195 ;; should not apply to Cygwin, I don't think
1196 'mswindows-multibyte-system-default 1196 'mswindows-multibyte-system-default)
1197 (let ((ncod (get-language-info langenv 'native-coding-system))) 1197 ((featurep 'cygwin-use-utf-8)
1198 (if (or (functionp ncod) (not (listp ncod))) 1198 'utf-8)
1199 (setq ncod (list ncod))) 1199 (t
1200 (let ((native 1200 (let ((ncod (get-language-info langenv 'native-coding-system)))
1201 (dolist (try-native ncod) 1201 (if (or (functionp ncod) (not (listp ncod)))
1202 (let ((result 1202 (setq ncod (list ncod)))
1203 (if (functionp try-native) 1203 (let ((native
1204 (funcall try-native locale) 1204 (dolist (try-native ncod)
1205 try-native))) 1205 (let ((result
1206 (if result (return result)))))) 1206 (if (functionp try-native)
1207 (or native (car (get-language-info langenv 'coding-system)) 1207 (funcall try-native locale)
1208 'raw-text))))) 1208 try-native)))
1209 (if result (return result))))))
1210 (or native (car (get-language-info langenv 'coding-system))
1211 'raw-text))))))
1209 1212
1210 (defun get-coding-system-from-locale (locale) 1213 (defun get-coding-system-from-locale (locale)
1211 "Return the coding system corresponding to a locale string." 1214 "Return the coding system corresponding to a locale string."
1212 (get-native-coding-system-from-language-environment 1215 (get-native-coding-system-from-language-environment
1213 (get-language-environment-from-locale locale) locale)) 1216 (get-language-environment-from-locale locale) locale))