From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Jesper Harder Newsgroups: gmane.emacs.bugs Subject: Re: detect-coding-string doesn't return all possibilities Date: Sat, 15 Mar 2003 00:04:08 +0100 Sender: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <200303140455.NAA22653@etlken.m17n.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1047683197 32686 80.91.224.249 (14 Mar 2003 23:06:37 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 14 Mar 2003 23:06:37 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 15 00:06:36 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18tyG3-0008V1-00 for ; Sat, 15 Mar 2003 00:06:35 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18tyGn-0001on-00 for gnu-bug-gnu-emacs@m.gmane.org; Fri, 14 Mar 2003 18:07:21 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18tyGc-0001nU-00 for bug-gnu-emacs@gnu.org; Fri, 14 Mar 2003 18:07:10 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18tyGb-0001mv-00 for bug-gnu-emacs@gnu.org; Fri, 14 Mar 2003 18:07:10 -0500 Original-Received: from pfepb.post.tele.dk ([193.162.153.3]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18tyEt-000129-00 for bug-gnu-emacs@gnu.org; Fri, 14 Mar 2003 18:05:23 -0500 Original-Received: from [195.249.130.107] (0xc3f9826b.esnxr3.ras.tele.dk [195.249.130.107]) by pfepb.post.tele.dk (Postfix) with ESMTP id AB6015EE0EB; Sat, 15 Mar 2003 00:05:19 +0100 (CET) Original-To: Kenichi Handa In-Reply-To: <200303140455.NAA22653@etlken.m17n.org> (Kenichi Handa's message of "Fri, 14 Mar 2003 13:55:17 +0900 (JST)") User-Agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.3.50 (gnu/linux) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:4615 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:4615 Kenichi Handa writes: > Jesper Harder writes: > >> Do you know of any other way to decide if using a given coding system >> for decoding a string would give a valid result? > How about this? > > (defun decode-coding-string-safely (string coding-system) > "Decode STRING by CODING-SYSYTEM and return the result. > If STRING contains invalid byte sequence for CODING-SYSTEM, return nil." Execellent. Thank you!