/[emacs]/emacs/src/mac.c
ViewVC logotype

Diff of /emacs/src/mac.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.47 by mituharu, Tue Nov 15 07:56:14 2005 UTC revision 1.48 by mituharu, Wed Nov 23 07:19:16 2005 UTC
# Line 265  posix_to_mac_pathname (const char *ufn, Line 265  posix_to_mac_pathname (const char *ufn,
265  #if TARGET_API_MAC_CARBON  #if TARGET_API_MAC_CARBON
266  static Lisp_Object Qstring, Qnumber, Qboolean, Qdate, Qdata;  static Lisp_Object Qstring, Qnumber, Qboolean, Qdate, Qdata;
267  static Lisp_Object Qarray, Qdictionary;  static Lisp_Object Qarray, Qdictionary;
 #define DECODE_UTF_8(str) code_convert_string_norecord (str, Qutf_8, 0)  
268    
269  struct cfdict_context  struct cfdict_context
270  {  {
# Line 336  cfdata_to_lisp (data) Line 335  cfdata_to_lisp (data)
335  }  }
336    
337    
338  /* From CFString to a lisp string.  Never returns a unibyte string  /* From CFString to a lisp string.  Returns a unibyte string
339     (even if it only contains ASCII characters).     containing a UTF-8 byte sequence.  */
    This may cause GC during code conversion. */  
340    
341  Lisp_Object  Lisp_Object
342  cfstring_to_lisp (string)  cfstring_to_lisp_nodecode (string)
343       CFStringRef string;       CFStringRef string;
344  {  {
345    Lisp_Object result = Qnil;    Lisp_Object result = Qnil;
# Line 362  cfstring_to_lisp (string) Line 360  cfstring_to_lisp (string)
360          }          }
361      }      }
362    
363      return result;
364    }
365    
366    
367    /* From CFString to a lisp string.  Never returns a unibyte string
368       (even if it only contains ASCII characters).
369       This may cause GC during code conversion. */
370    
371    Lisp_Object
372    cfstring_to_lisp (string)
373         CFStringRef string;
374    {
375      Lisp_Object result = cfstring_to_lisp_nodecode (string);
376    
377    if (!NILP (result))    if (!NILP (result))
378      {      {
379        result = DECODE_UTF_8 (result);        result = code_convert_string_norecord (result, Qutf_8, 0);
380        /* This may be superfluous.  Just to make sure that the result        /* This may be superfluous.  Just to make sure that the result
381           is a multibyte string.  */           is a multibyte string.  */
382        result = string_to_multibyte (result);        result = string_to_multibyte (result);
# Line 1141  xrm_get_preference_database (application Line 1153  xrm_get_preference_database (application
1153    CFSetGetValues (key_set, (const void **)keys);    CFSetGetValues (key_set, (const void **)keys);
1154    for (index = 0; index < count; index++)    for (index = 0; index < count; index++)
1155      {      {
1156        res_name = SDATA (cfstring_to_lisp (keys[index]));        res_name = SDATA (cfstring_to_lisp_nodecode (keys[index]));
1157        quarks = parse_resource_name (&res_name);        quarks = parse_resource_name (&res_name);
1158        if (!(NILP (quarks) || *res_name))        if (!(NILP (quarks) || *res_name))
1159          {          {

Legend:
Removed from v.1.47  
changed lines
  Added in v.1.48

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26