From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 37849 invoked by alias); 15 Jun 2018 06:41:38 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 37816 invoked by uid 89); 15 Jun 2018 06:41:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com To: GNU C Library From: Florian Weimer Subject: Deprecate ,ccs= parameter for fopen Cc: Arjun Shankar Message-ID: Date: Fri, 15 Jun 2018 06:41:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2018-06/txt/msg00434.txt.bz2 I suggest that we deprecate the ,ccs= parameter for fopen, and eventually disable it for new programs. The benefit of doing that is that in the future, statically linked programs calling fopen will not have to link in the gconv machinery (which, currently, includes the dynamic loader). Instead, I would like to see a function like this one: int fwide_charset (FILE *fp, const char *charset, unsigned int flags); Mark the stream FP as wide-character orientation, and set the external file encoding to CHARSET. CHARSET must be a character set name as used by the iconv_open function. The FLAGS argument is for future extension and must currently be specified as zero. Return value: 0 on success, -1 on error. Error codes: EINVAL flags is not zero. EBUSY The stream is already wide-oriented or narrow-oriented. I propose to add the FLAGS argument right away. We eventually want to specify error handling both on input and output (error, ignore, replacement character) and transliteration, but this requires gconv/iconv cleanups which do not currently exist. With a separate fwide_charset function, only that function and the wide-character stream functions will pull in the gconv implementation (which still we be a bit clunky even if we no longer need the dynamic loader as part of it). Comments? Thanks, Florian