Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #85434

Re: Python 3.x stuffing utf-8 into SQLite db

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!enother.net!enother.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <skip.montanaro@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.010
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'encoding': 0.05; 'pop': 0.05; 'subject:Python': 0.06; 'instance.': 0.09; 'subject:into': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'windows': 0.15; 'csv': 0.16; 'fancy': 0.16; 'linux).': 0.16; ':-)': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'file,': 0.19; 'feb': 0.22; 'cc:addr:python.org': 0.22; 'error': 0.23; 'skip': 0.24; 'unicode': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; '&gt;': 0.26; 'least': 0.26; 'excel': 0.26; 'header:In-Reply-To:1': 0.27; 'appear': 0.29; 'correct': 0.29; 'am,': 0.29; 'involving': 0.30; 'message-id:@mail.gmail.com': 0.30; '(my': 0.31; '(on': 0.31; '(unless': 0.31; '3.x': 0.31; 'loading': 0.31; 'file': 0.32; 'stuff': 0.32; 'up.': 0.33; 'running': 0.33; 'actual': 0.34; "i'd": 0.34; 'something': 0.35; 'received:google.com': 0.35; 'doing': 0.36; 'sometimes': 0.38; 'that,': 0.38; 'even': 0.60; 'guy': 0.60; 'most': 0.60; 'first': 0.61; 'virus:src="cid:': 0.66; 'here': 0.66; 'content-type:multipart/related': 0.67; 'export': 0.74; '2015': 0.84; 'darn': 0.84; 'here...': 0.84; 'snapshot': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=SFydqxHf+NFXVy/cnfmVJSHAz4PzpcUoQqvD9/Dv1Ms=; b=W/KbxNeEhpzfbQHC5TqJuUO/QbtYVedy01eYJKyD4LSOwu171g6e5eao80S0+wlJ46 qWoUxlqePAvCBoWwfw4Le10SeLegvTXUC5AYmKRdScqOb+oLKOql5nCj0HNn+Oynr3Jf vyxJUF7gEOkBOaZ2mljtCpZVJ5FP992LVoZmB46qzgVsOJ2J+B7JauVDu3k06cPwXRWD wxZADc6Pwm9grta1hDQXop6VNEEVrV3hoQISMBqGvf42c9lX5UkgjYkjQgVqGgvCu3KO ZPodkYbJTGPd2rM92neVppdWArFGA0prIBYy3LuA6V3IlQPmWrmV9qwumaAUKGqAdATP jeQw==
MIME-Version 1.0
X-Received by 10.60.133.137 with SMTP id pc9mr13069317oeb.68.1423507974935; Mon, 09 Feb 2015 10:52:54 -0800 (PST)
In-Reply-To <54D8F438.1060402@case.edu>
References <CANc-5UwYdoPLKuqRbrfbOrQTVafOaZmWZ+8SnDc-TZp1NEXcQg@mail.gmail.com> <CAPTjJmpJV4KYcL50_=0hv+BLKaGX_X9wqQgMJeszMrHgAK+drA@mail.gmail.com> <CANc-5Uwb51DKan1xgqwWDT2WFAZk-_NcqgLcnQfzYHzQzps3xA@mail.gmail.com> <54D8F438.1060402@case.edu>
Date Mon, 9 Feb 2015 12:52:54 -0600
Subject Re: Python 3.x stuffing utf-8 into SQLite db
From Skip Montanaro <skip.montanaro@gmail.com>
To Matthew Ruffalo <mmr15@case.edu>
Content-Type multipart/related; boundary=047d7b4725ee2e9e82050eac47d2
X-Mailman-Approved-At Tue, 10 Feb 2015 09:01:54 +0100
Cc Python <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.18601.1423555315.18130.python-list@python.org> (permalink)
Lines 896
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1423555315 news.xs4all.nl 2915 [2001:888:2000:d::a6]:54829
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:85434

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On Mon, Feb 9, 2015 at 11:54 AM, Matthew Ruffalo <mmr15@case.edu> wrote:
> I think it's most likely that the encoding issues happened in the export
> from XLSX to CSV (unless the data is malformed in the original XLSX
> file, of course).

Aha! Lookee here... (my apologies to all you HTML mail haters - sometimes
it even comes in handy. :-)


This snapshot was taken against a running LibreOffice instance here at work
(on Linux). It would appear the fancy schmancy apostrophe was hosed up
before the data ever got to me. Had a guy here with Windows pop up the
original file I got in an actual Excel instance. Same bogosity.

Knowing that, I don't feel the least bit timid about just editing the darn
CSV file to correct the encode/decode/encode error before loading the data
into SQLite. I was worried that since I was doing some Python 3.x stuff
involving Unicode for the first time that I'd screwed something up.

Skip

​

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Python 3.x stuffing utf-8 into SQLite db Skip Montanaro <skip.montanaro@gmail.com> - 2015-02-09 12:52 -0600

csiph-web