From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [elpa] 02/04: company-clang: handle multibyte chars between bol and point Date: Thu, 20 Mar 2014 05:58:40 +0200 Message-ID: <83k3bp8qrz.fsf@gnu.org> References: <20140319033013.17542.14344@vcs.savannah.gnu.org> <87mwgm9t81.fsf@yandex.ru> <834n2u9lj7.fsf@gnu.org> <5329DA52.2030704@yandex.ru> <83vbva82cy.fsf@gnu.org> <532A08FF.8020001@yandex.ru> <87ior9pohp.fsf@yandex.ru> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1395287914 4273 80.91.229.3 (20 Mar 2014 03:58:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Mar 2014 03:58:34 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 20 04:58:42 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WQU7u-0004fh-3J for ged-emacs-devel@m.gmane.org; Thu, 20 Mar 2014 04:58:42 +0100 Original-Received: from localhost ([::1]:45086 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQU7t-00033y-O8 for ged-emacs-devel@m.gmane.org; Wed, 19 Mar 2014 23:58:41 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQU7m-00033p-ID for emacs-devel@gnu.org; Wed, 19 Mar 2014 23:58:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WQU7h-0000Rv-O4 for emacs-devel@gnu.org; Wed, 19 Mar 2014 23:58:34 -0400 Original-Received: from mtaout28.012.net.il ([80.179.55.184]:52046) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQU7h-0000Rq-Fh for emacs-devel@gnu.org; Wed, 19 Mar 2014 23:58:29 -0400 Original-Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0N2P00100TTOB000@mtaout28.012.net.il> for emacs-devel@gnu.org; Thu, 20 Mar 2014 05:58:24 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N2P00NNYV1BY750@mtaout28.012.net.il>; Thu, 20 Mar 2014 05:58:24 +0200 (IST) In-reply-to: <87ior9pohp.fsf@yandex.ru> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.184 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:170594 Archived-At: > From: Dmitry Gutov > Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org > Date: Thu, 20 Mar 2014 04:56:02 +0200 > > >>> (length (encode-coding-string STR buffer-file-coding-system)) > > Alas, this doesn't work. If I set the file's encoding to UTF-16, the > current code works (with Clang 3.4), whereas using the approach above, > doesn't. Please tell the details: what does "don't work" mean? > So looks like Clang uses some other encoding than that the file is saved > to disk with. > > Probably UTF-8 or similar, which isn't far from utf-8-emacs. The question is not what Clang uses, the question is how does it expect the offsets to be supplied for files encoded in different encodings. That is something that should be described in the Clang manuals. I assumed that it needs offsets in bytes, but that assumption was not based on anything except looking at your code.