Return-Path: <tiff-bounces@lists.maptools.org>
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-f.b-one.net (mx-f.one.com [91.198.169.53])
	by mail9.b-one.net (Postfix) with ESMTP id CC31C40080A
	for <info@awaresystems.be>; Mon,  8 Feb 2010 13:45:41 +0100 (CET)
Received: by mx-f.b-one.net (Postfix, from userid 106)
	id C130C21495FB; Mon,  8 Feb 2010 13:45:41 +0100 (CET)
X-Virus-Scanned: by one.com
X-Spam-Score: 0
X-Spam-Level: 
X-Spam-Status: No, score=0 tagged_above=0 required=4 tests=[none]
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144]) by
 mx-f.b-one.net (Postfix) with ESMTP id E25D819920 for <info@awaresystems.be>;
 Mon,  8 Feb 2010 13:45:40 +0100 (CET)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by
 lists.maptools.org (Postfix) with ESMTP id BCE471D18F527; Mon,  8 Feb 2010
 07:45:07 -0500 (EST)
Received: from morrigan.instanthosting.com.au (morrigan.instanthosting.com.au
 [116.0.23.220]) by lists.maptools.org (Postfix) with ESMTPS id 7B7AF1D18FA51
 for <tiff@lists.maptools.org>; Mon,  8 Feb 2010 07:44:08 -0500 (EST)
Received: from 202.164.193.21.static.rev.aanet.com.au ([202.164.193.21]
 helo=[10.0.0.1]) by morrigan.instanthosting.com.au with esmtpa (Exim 4.69)
 (envelope-from <graeme2@argyllcms.com>) id 1NeSy8-0004fT-IT for
 tiff@lists.maptools.org; Mon, 08 Feb 2010 23:44:00 +1100
Message-ID: <4B700595.9040003@argyllcms.com>
Date: Mon, 08 Feb 2010 23:37:41 +1100
From: Graeme Gill <graeme2@argyllcms.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.13)
 Gecko/20080313 SeaMonkey/1.1.9
MIME-Version: 1.0
To: libtiff - Liste <tiff@lists.maptools.org>
X-cPanel-MailScanner-Information: Please contact the ISP for more information
X-cPanel-MailScanner-ID: 1NeSy8-0004fT-IT
X-cPanel-MailScanner: Not scanned: please contact your Internet E-Mail
 Service Provider for details
X-cPanel-MailScanner-SpamCheck: 
X-cPanel-MailScanner-From: graeme2@argyllcms.com
X-AntiAbuse: This header was added to track abuse, please include it with any
 abuse report
X-AntiAbuse: Primary Hostname - morrigan.instanthosting.com.au
X-AntiAbuse: Original Domain - lists.maptools.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - argyllcms.com
X-Source: 
X-Source-Args: 
X-Source-Dir: 
Subject: [Tiff] Libtiff and UTF-8 filename support
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: graeme@argyllcms.com
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
 <mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
 <mailto:tiff-request@lists.maptools.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org


I was looking though the libtiff V4.0.0beta5 sources, and noticed
that there is probably a discrepancy between the behavior of
Libtiff between MSWindows and Unix like platforms with regard
to filename encoding.

On Unix like systems (tif_unix.c) TIFFOpen calls the open()
with a possibly UTF-8 filename, while in tif_win32.c it calls
CreateFileA(), which doesn't take a UTF-8 argument.

This means that in otherwise platform independent software,
there needs to be some ugly code above libtiff to handle these
two cases

Wouldn't it be better to make TIFFOpen support UTF-8
on both Unix and MSWindows, by making tif_win32.c do
a MultiByteToWideChar() and then use CreateFileW() ?
(or would this create problems in code that expects
there to be differences between the platforms ?)

[TIFFOpenW() could remain for those who have platform
  specific code at that level.]

Graeme Gill.

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
