Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XVZY7-0007aJ-8S for pgsql-bugs@arkaria.postgresql.org; Sun, 21 Sep 2014 05:19:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XVZY5-0003kK-9S for pgsql-bugs@arkaria.postgresql.org; Sun, 21 Sep 2014 05:19:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XVZY3-0003kB-BE for pgsql-bugs@postgresql.org; Sun, 21 Sep 2014 05:18:59 +0000 Received: from mail-pa0-x22d.google.com ([2607:f8b0:400e:c03::22d]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XVZXx-0006OV-3h for pgsql-bugs@postgresql.org; Sun, 21 Sep 2014 05:18:58 +0000 Received: by mail-pa0-f45.google.com with SMTP id lj1so1718821pab.18 for ; Sat, 20 Sep 2014 22:18:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=SbDHTfaPWMEmO09p62nP8waek/ploj0LYIrDh5d243s=; b=YTKLxSmukGP8SyQCs/S1kgFvgsrNvMAGLep6J2A/cVgYjEZtrGv1r1VaxxYQUHuPxK JOhw/uIGgt2vdfbPp73N8d3lbO3LxiGnacwId/+RYf/mkgJbNMYJIm27iFkiAVfuAH4Y +4BT0yjfoGvqksj8byFeEfCe8IBFTdg91Vad0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=SbDHTfaPWMEmO09p62nP8waek/ploj0LYIrDh5d243s=; b=A5UbrQ9ttAN4yOBXY0ixjozXGVgcjwTstVRQwE7rc4ofzthbO1Ucnn9wWeeFkNBqTX HPWTv4icdMlj3uy3CBMmz6YWciCacuj7hnL8GWiVqblVmgR4LLrSbX9kwZnjz0LHKCES z3A4g+a+U5vhUar4f/xXpIke7DP2PB69+nqXDuAHS36FnyrSNAjqesrzyQBF5cGdcmCe D56o8Bsrwn1XRjxAU8OIp1Hp+V+Fpc/c4WqMVm9UsvpFnASs28ZwbN+XK16x+iCvSTy9 yjDOtItuK8CKQUjU4HN5GCPm2WkHKrhzVKZb6BtUq96sZcOevTRIsrhIZPRGJA+ns8eF s5Fw== X-Gm-Message-State: ALoCoQk2cR4hgTJ/e57O7G0DjcKcbY0yAuk4mqOXprluDVyNMuHn47tjTDHAHeFIbmlfmciiPQLc X-Received: by 10.70.129.106 with SMTP id nv10mr16873238pdb.24.1411276729149; Sat, 20 Sep 2014 22:18:49 -0700 (PDT) Received: from tornado.leadboat.com (c-174-62-109-97.hsd1.ca.comcast.net. [174.62.109.97]) by mx.google.com with ESMTPSA id p12sm5876657pdl.41.2014.09.20.22.18.48 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 20 Sep 2014 22:18:48 -0700 (PDT) Date: Sun, 21 Sep 2014 01:18:46 -0400 From: Noah Misch To: Alon Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #11431: Failing =?iso-8859-1?Q?to_?= =?iso-8859-1?Q?backup_and_restore_a_Windows_postgres_database=2C_with_Nor?= =?iso-8859-1?Q?wegian_Bokm=E5l?= locale. Message-ID: <20140921051846.GA1565935@tornado.leadboat.com> References: <20140915230427.2486.29437@wrigleys.postgresql.org> <1411164953375-5819745.post@n5.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1411164953375-5819745.post@n5.nabble.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On Fri, Sep 19, 2014 at 03:15:53PM -0700, Alon wrote: > The pg_dump file contains this command: > CREATE DATABASE workgroup WITH TEMPLATE = template0 ENCODING = 'UTF8' > LC_COLLATE = 'Norwegian (Bokmål)_Norway.1252' LC_CTYPE = 'Norwegian > (Bokmål)_Norway.1252'; > > The UTF16 encoding for ål) [a-ring l parenthesis] is > 00e5 006c 0029 > > In UTF8 this set of characters encoded as: > c3 a5 6c 29 > > The a-ring is converted to two bytes while the others are one. > > Based on the ERROR: > invalid byte sequence for encoding "UTF8": 0xe5 0x6c 0x29 > > It appears the set of characters is getting passed as: > e5 6c 29 > > In UTF8, e5 is always the start of a three byte character,possibly > pg_restore, ceratedb or else, tries to read these bytes as a single > character. > However, 6c and 29 can only be single byte characters, they can't be the > next two bytes in a three byte character. Hence the failure. > Seems like in the code, the 00xe5 is converted to e5 instead of 'c3 a5' when > passing the LC_COLLATE and LC_CTYPE values. In WIN1252, "e5 6c 29" is "ål)". We're likely failing to set client_encoding at some essential point in the process. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs