* [w32] MBCS support
@ 2005-03-31 5:53 KOBAYASHI Yasuhiro
0 siblings, 0 replies; only message in thread
From: KOBAYASHI Yasuhiro @ 2005-03-31 5:53 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 326 bytes --]
I have the trouble that I can't see the filename containing the
charactor 'ポ'(0x837c) in a dired buffer.
_mbspbrk() instead of strpbrk() is OK.
Though I don't know about MBCS support well, I think that
using tchar.h is a good solution.
How about the following patch?
--
KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: w32.c --]
[-- Type: text/x-patch, Size: 1273 bytes --]
Index: src/w32.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/w32.c,v
retrieving revision 1.90
diff -u -r1.90 w32.c
--- src/w32.c 15 Feb 2005 23:19:26 -0000 1.90
+++ src/w32.c 29 Mar 2005 13:49:57 -0000
@@ -74,6 +74,11 @@
#endif
#include <windows.h>
+#include <tchar.h>
+#ifdef _MBCS /* MBCS is not supported on Mingw32 */
+#define _tcspbrk _mbspbrk
+#endif
+
#ifdef HAVE_SOCKETS /* TCP connection support, if kernel can do it */
#include <sys/socket.h>
#undef socket
@@ -713,7 +718,7 @@
int len = 0;
/* must be valid filename, no wild cards or other invalid characters */
- if (strpbrk (name, "*?|<>\""))
+ if (_tcspbrk (name, "*?|<>\""))
return 0;
dir_handle = FindFirstFile (name, &find_data);
@@ -788,7 +793,7 @@
if (!IS_DIRECTORY_SEP (ptr[0]) || !IS_DIRECTORY_SEP (ptr[1]) || !ptr[2])
return 0;
- if (strpbrk (ptr + 2, "*?|<>\"\\/"))
+ if (_tcspbrk (ptr + 2, "*?|<>\"\\/"))
return 0;
return 1;
@@ -2311,7 +2316,7 @@
name = (char *) map_w32_filename (path, &path);
/* must be valid filename, no wild cards or other invalid characters */
- if (strpbrk (name, "*?|<>\""))
+ if (_tcspbrk (name, "*?|<>\""))
{
errno = ENOENT;
return -1;
[-- Attachment #3: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-03-31 5:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-31 5:53 [w32] MBCS support KOBAYASHI Yasuhiro
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).