From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
To: Keitaro Miyazaki <keitaro.miyazaki@gmail.com>
Cc: 7282@debbugs.gnu.org
Subject: bug#7282: 23.2; [PATCH] Improve text composition by Input Methods on MacOSX.
Date: Thu, 28 Oct 2010 15:35:38 +0900 [thread overview]
Message-ID: <wl39rqsu2t.wl%mituharu@math.s.chiba-u.ac.jp> (raw)
In-Reply-To: <AANLkTikQ71OcUkD_WSyMkbP=ZwwJovf4iSwqHCSmXu5+@mail.gmail.com>
>>>>> On Thu, 28 Oct 2010 15:15:54 +0900, Keitaro Miyazaki <keitaro.miyazaki@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@math.s.chiba-u.ac.jp
next prev parent reply other threads:[~2010-10-28 6:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-26 12:20 bug#7282: 23.2; [PATCH] Improve text composition by Input Methods on MacOSX Keitaro Miyazaki
2010-10-27 5:46 ` YAMAMOTO Mitsuharu
2010-10-27 6:17 ` YAMAMOTO Mitsuharu
2010-10-27 14:56 ` Keitaro Miyazaki
2010-10-28 0:55 ` YAMAMOTO Mitsuharu
2010-10-28 6:15 ` Keitaro Miyazaki
2010-10-28 6:35 ` YAMAMOTO Mitsuharu [this message]
2010-10-28 15:31 ` Keitaro Miyazaki
2016-07-10 15:15 ` Alan Third
2017-12-27 0:14 ` Alan Third
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=wl39rqsu2t.wl%mituharu@math.s.chiba-u.ac.jp \
--to=mituharu@math.s.chiba-u.ac.jp \
--cc=7282@debbugs.gnu.org \
--cc=keitaro.miyazaki@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).