comparison src/coding.h @ 60657:aa6d20307ac6

(ENCODE_SYSTEM, DECODE_SYSTEM) [!WINDOWSNT]: Use the locale-coding-system, as was already done for WINDOWSNT.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 17 Mar 2005 00:37:35 +0000
parents 44a9e60f1d12
children a8fa7c632ee4 1830bcd0eec0 30ad2795fdab
comparison
equal deleted inserted replaced
60656:f49f92a8d1b1 60657:aa6d20307ac6
1 /* Header for coding system handler. 1 /* Header for coding system handler.
2 Copyright (C) 2004 Free Software Foundation, Inc. 2 Copyright (C) 2004, 2005 Free Software Foundation, Inc.
3 Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN. 3 Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN.
4 Licensed to the Free Software Foundation. 4 Licensed to the Free Software Foundation.
5 5
6 This file is part of GNU Emacs. 6 This file is part of GNU Emacs.
7 7
589 : (! NILP (Vdefault_file_name_coding_system) \ 589 : (! NILP (Vdefault_file_name_coding_system) \
590 && !EQ (Vdefault_file_name_coding_system, make_number (0)) \ 590 && !EQ (Vdefault_file_name_coding_system, make_number (0)) \
591 ? code_convert_string_norecord (name, Vdefault_file_name_coding_system, 0) \ 591 ? code_convert_string_norecord (name, Vdefault_file_name_coding_system, 0) \
592 : name)) 592 : name))
593 593
594 #ifdef WINDOWSNT
595 /* Encode the string STR using the specified coding system 594 /* Encode the string STR using the specified coding system
596 for w32 system functions, if any. */ 595 for system functions, if any. */
597 #define ENCODE_SYSTEM(str) \ 596 #define ENCODE_SYSTEM(str) \
598 (! NILP (Vlocale_coding_system) \ 597 (! NILP (Vlocale_coding_system) \
599 && !EQ (Vlocale_coding_system, make_number (0)) \ 598 && !EQ (Vlocale_coding_system, make_number (0)) \
600 ? code_convert_string_norecord (str, Vlocale_coding_system, 1) \ 599 ? code_convert_string_norecord (str, Vlocale_coding_system, 1) \
601 : str) 600 : str)
602 601
603 /* Decode the string STR using the specified coding system 602 /* Decode the string STR using the specified coding system
604 for w32 system functions, if any. */ 603 for system functions, if any. */
605 #define DECODE_SYSTEM(name) \ 604 #define DECODE_SYSTEM(name) \
606 (! NILP (Vlocale_coding_system) \ 605 (! NILP (Vlocale_coding_system) \
607 && !EQ (Vlocale_coding_system, make_number (0)) \ 606 && !EQ (Vlocale_coding_system, make_number (0)) \
608 ? code_convert_string_norecord (str, Vlocale_coding_system, 0) \ 607 ? code_convert_string_norecord (str, Vlocale_coding_system, 0) \
609 : str) 608 : str)
610
611 #else /* WINDOWSNT */
612
613 #define ENCODE_SYSTEM(str) string_make_unibyte(str)
614 #define DECODE_SYSTEM(name) name
615
616 #endif /* !WINDOWSNT */
617 609
618 #define ENCODE_UTF_8(str) code_convert_string_norecord (str, Qutf_8, 1) 610 #define ENCODE_UTF_8(str) code_convert_string_norecord (str, Qutf_8, 1)
619 611
620 /* Extern declarations. */ 612 /* Extern declarations. */
621 extern int decode_coding P_ ((struct coding_system *, const unsigned char *, 613 extern int decode_coding P_ ((struct coding_system *, const unsigned char *,