GNU bug report logs - #7282
23.2; [PATCH] Improve text composition by Input Methods on MacOSX.

Previous Next

Package: emacs;

Reported by: Keitaro Miyazaki <keitaro.miyazaki <at> gmail.com>

Date: Tue, 26 Oct 2010 13:35:02 UTC

Severity: normal

Tags: patch

Done: Alan Third <alan <at> idiocy.org>

Bug is archived. No further changes may be made.

Full log


Message #23 received at 7282 <at> debbugs.gnu.org (full text, mbox):

From: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
To: Keitaro Miyazaki <keitaro.miyazaki <at> gmail.com>
Cc: 7282 <at> debbugs.gnu.org, YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
Subject: Re: bug#7282: 23.2;
	[PATCH] Improve text composition by Input Methods on MacOSX.
Date: Thu, 28 Oct 2010 15:35:38 +0900
>>>>> On Thu, 28 Oct 2010 15:15:54 +0900, Keitaro Miyazaki <keitaro.miyazaki <at> gmail.com> said:

> Do you mean that there are some cases that the number of characters
> in a string, in other words, the length of a string, is different
> from the one counted by NSString to the one counted by Emacs?

> If so, could you show me any example of these cases?

I mentioned "non-BMP characters" in the previous reply.

(mapcar 'length (list (string #xffff) (string #x10000)))

=> (1 1)

#import <Cocoa/Cocoa.h>
#include <stdio.h>

main()
{
  NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
  const char str1[] = {0xef, 0xbf, 0xbf, '\0'}; // U+ffff in UTF-8
  const char str2[] = {0xf0, 0x90, 0x80, 0x80, '\0'}; // U+10000 in UTF-8
  NSString *string1 = [NSString stringWithUTF8String:str1];
  NSString *string2 = [NSString stringWithUTF8String:str2];

  printf ("%ld %ld\n", [string1 length], [string2 length]);
  [pool release];
}

=> 1 2

				     YAMAMOTO Mitsuharu
				mituharu <at> math.s.chiba-u.ac.jp




This bug report was last modified 7 years and 151 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.