>>>>> On Fri, 14 Oct 2005 11:57:27 +0100, David Reitter <[EMAIL PROTECTED]> 
>>>>> said:

> Tried this, didn't work.

Oops, CFStringCreateExternalRepresentation also adds BOM.  Please try
the following patch together with the previous one.

                                     YAMAMOTO Mitsuharu
                                [EMAIL PROTECTED]

Index: src/mac.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/mac.c,v
retrieving revision 1.44
diff -c -r1.44 mac.c
*** src/mac.c   7 Aug 2005 12:33:17 -0000       1.44
--- src/mac.c   15 Oct 2005 01:01:59 -0000
***************
*** 4126,4132 ****
    Lisp_Object result = Qnil;
    CFStringEncoding src_encoding, tgt_encoding;
    CFStringRef str = NULL;
-   CFDataRef data = NULL;
  
    CHECK_STRING (string);
    if (!INTEGERP (source) && !STRINGP (source))
--- 4126,4131 ----
***************
*** 4160,4173 ****
  #endif
    if (str)
      {
!       data = CFStringCreateExternalRepresentation (NULL, str,
!                                                  tgt_encoding, '\0');
        CFRelease (str);
-     }
-   if (data)
-     {
-       result = cfdata_to_lisp (data);
-       CFRelease (data);
      }
  
    UNBLOCK_INPUT;
--- 4159,4175 ----
  #endif
    if (str)
      {
!       CFIndex str_len, buf_len;
! 
!       str_len = CFStringGetLength (str);
!       if (CFStringGetBytes (str, CFRangeMake (0, str_len), tgt_encoding,
!                           0, false, NULL, 0, &buf_len) == str_len)
!       {
!         result = make_uninit_string (buf_len);
!         CFStringGetBytes (str, CFRangeMake (0, str_len), tgt_encoding,
!                           0, false, SDATA (result), buf_len, NULL);
!       }
        CFRelease (str);
      }
  
    UNBLOCK_INPUT;


_______________________________________________
Emacs-pretest-bug mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Reply via email to