From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.user Subject: Re: guile can't find a chinese named file Date: Mon, 27 Feb 2017 12:02:12 +0100 Message-ID: <87innvsxqj.fsf@pobox.com> References: <874m0gd3z4.fsf@gnu.org> <87wpdc8rx7.fsf@elektro.pacujo.net> <87poj4r04c.fsf@fencepost.gnu.org> <87k29c8q3b.fsf@elektro.pacujo.net> <87h94gqz34.fsf@fencepost.gnu.org> <87fuk0ctve.fsf@elektro.pacujo.net> <878tpsqtzl.fsf@fencepost.gnu.org> <87zii8bcdw.fsf@elektro.pacujo.net> <87y3xspcux.fsf@fencepost.gnu.org> <578885360.4452806.1487105647708@mail.yahoo.com> <87inoc5npq.fsf@fencepost.gnu.org> <8737f0tzs0.fsf@pobox.com> <87zih8ngm8.fsf@fencepost.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1488193377 14307 195.159.176.226 (27 Feb 2017 11:02:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 27 Feb 2017 11:02:57 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Feb 27 12:02:52 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ciJ4t-0003Im-J2 for guile-user@m.gmane.org; Mon, 27 Feb 2017 12:02:51 +0100 Original-Received: from localhost ([::1]:51641 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciJ4z-0006d4-LD for guile-user@m.gmane.org; Mon, 27 Feb 2017 06:02:57 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciJ4S-0006bB-8X for guile-user@gnu.org; Mon, 27 Feb 2017 06:02:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciJ4P-0004Xf-5O for guile-user@gnu.org; Mon, 27 Feb 2017 06:02:24 -0500 Original-Received: from pb-sasl1.pobox.com ([64.147.108.66]:53471 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ciJ4P-0004XW-18 for guile-user@gnu.org; Mon, 27 Feb 2017 06:02:21 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 45F365B569 for ; Mon, 27 Feb 2017 06:02:20 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=CK4azpc9Lf7+dOU2PN6xfKUPtAw=; b=SQqpnR nnGCD1yIjAnKYt+Pz17XxiChnbgiSSGImE7XUR4a9A4frUYEqd8XZyeICkOOwOC/ JLwoUwNgRYv7HHQaKhGUPKNagKui35UyHgZyT/Ok6ywalZcLCRqjBYhxk2TR9VQ9 HxfV1iQgJzSqZrFbqcfTUyVFUTYczaAhD36dI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:subject :references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=lDNL2Nw9OH0fk27ON1O/YtDBekssIP6p YOwhZe6x94r1s+W+0G4DbQOVcqxNarilFRPsUXP5L+m9pAvGdMQtOIcXRooWKzgq 6WA1yK55H7iQepi3ZeuHzhFKH0r4prqJDr6ciRS3f12ycCgWEEeS/vdZBFcT1RMM QIgGdLSHLBg= Original-Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 3D1C75B566 for ; Mon, 27 Feb 2017 06:02:20 -0500 (EST) Original-Received: from clucks (unknown [109.190.228.233]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl1.pobox.com (Postfix) with ESMTPSA id 3C2BF5B562 for ; Mon, 27 Feb 2017 06:02:19 -0500 (EST) In-Reply-To: <87zih8ngm8.fsf@fencepost.gnu.org> (David Kastrup's message of "Mon, 27 Feb 2017 10:10:55 +0100") X-Pobox-Relay-ID: 35103096-FCDC-11E6-A4E1-CDEC6462E9F6-02397024!pb-sasl1.pobox.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.147.108.66 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:13330 Archived-At: Hello, On Mon 27 Feb 2017 10:10, David Kastrup writes: > Andy Wingo writes: > >> Legacy programs don't use codepoints >255. > > Sort of a moot point when Guile makes the decision to interpret external > files with codepoints >255. Not every data processed by a "legacy > program" originates from inside the program. Not a moot point at all. If you want to decode/encode characters to/from ports, you have to call Guile's setlocale function; that's a choice you can make. In Guile 1.8 and earlier regardless you would just get ISO-8859-1 one-character-per-byte, so no significant change here. If you would prefer to continue to use this encoding with every port in your program, you can do that. >> In Scheme, strings are sequences of characters. Encoding and decoding >> is only needed when going to and from bytes. > > A string port is strictly passing characters to characters completely > inside of Guile This is an implementation concern. May I remind you and the list that we have kindly asked you to not post to guile-devel because implementation discussions with you are not productive. I'm not interested in having similar discussions, only on another list. Thanks. >>> PostScript files are usually encoded in Latin-1 with occasional UCS-16 >>> passages. Reading and writing and copying such files byte-correctly >>> while trying to actually parse their contents is not feasible with >>> Guile. >> >> Works perfectly well. The web server for example reads the request as >> Latin-1 and the body as something else. Just re-set the port encoding >> and there you go. > > Reading and writing and copying cannot always afford to _parse_ and > switch encodings based on the content. It needs to work even when you > don't do that. If you would like to read just the bytes and parse yourself, you can do that too. Re-setting the encoding while parsing from a port can often be more efficient though, as you don't have to read all of the data and then parse it all; you can parse incrementally. >> String ports have nothing to do with the discussion AFAIU. (Ports in >> Guile are sequences of bytes also. They may be accessed using >> textual interfaces as well. > > They can _only_ be accessed using textual interfaces. They are > character-in/character-out. You misunderstand what Guile ports are. I seriously invite you to read the fine manual, specifically the first four subsections of this node: https://www.gnu.org/software/guile/docs/master/guile.html/Input-and-Output.html Thanks, Andy