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


Groups > comp.lang.python.announce > #3191

A proof of concept to replace unreliable python chardet

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Ahmed TAHRI <ahmed.tahri@cloudnursery.dev>
Newsgroups comp.lang.python.announce
Subject A proof of concept to replace unreliable python chardet
Date Fri, 13 Sep 2019 11:18:01 +0200
Lines 32
Approved python-announce-list@python.org
Message-ID <156837898745.16868.python-announce-list@python.org> (permalink)
Reply-To python-list@python.org
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
X-Trace news.uni-berlin.de QQKiq1yI95tnDNXk7FkieQzKGjK2g+ecnFr59cmzpOYg==
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'url:github': 0.03; 'url:psf': 0.03; 'url-ip:140.82.118/24': 0.04; 'url-ip:140.82/16': 0.04; 'encoding': 0.05; 'obsolete': 0.07; 'url:pypi': 0.07; 'resolved': 0.09; 'url:project': 0.09; 'subject:python': 0.09; 'bindings.': 0.16; 'charset': 0.16; 'different,': 0.16; 'encoding.': 0.16; 'url-ip:140/8': 0.16; 'url- ip:151.101.0.223/32': 0.21; 'url-ip:151.101.128.223/32': 0.21; 'url-ip:151.101.192.223/32': 0.21; 'url-ip:151.101.64.223/32': 0.21; 'coding': 0.23; 'guess': 0.25; 'url-ip:151.101.192/24': 0.26; 'url-ip:151.101.0/24': 0.27; 'url-ip:151.101.128/24': 0.27; 'url-ip:151.101.64/24': 0.27; 'issue': 0.27; 'idea': 0.28; 'to:addr:python-announce-list': 0.29; 'url-ip:151.101/16': 0.31; 'url-ip:151/8': 0.31; 'message-id:@mail.gmail.com': 0.32; 'but': 0.33; 'methods': 0.33; 'requests': 0.33; 'received:google.com': 0.35; 'should': 0.36; 'there': 0.36; 'still': 0.37; 'version': 0.38; 'could': 0.38; 'file': 0.38; 'point': 0.39; 'consider': 0.39; 'why': 0.39; '(one': 0.61; 'popular': 0.61; 'reality': 0.64; 'internet': 0.65; 'per': 0.65; 'discovering': 0.66; 'real': 0.73; 'universal': 0.74; 'license': 0.80; 'resources.': 0.82; 'instance)': 0.84; 'partially': 0.84; 'subject:replace': 0.84; 'url:requests': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudnursery.dev; s=google; h=mime-version:from:date:message-id:subject:to; bh=UZ7E5Bo+/eE1jKOYrWOcMYFkMjRA9wTz1VirhpgCpEY=; b=Y5Ef0VMyKZmPrYLCNs6+w5berB7v/Psx6m5jkuzQcC2KIvmHRPdh64NZovxoHKJiDX 8n8EdhOXFYSf4GepqQQaR5RQjgUrXCvsV56+lbs0Ya5TlpGHSIZq1hnE78zSZM1P8C6J TH7MZerFWiteRvcSJJTI90cfPvhp6nR5h/ADBNJDnJgfy2q12ve93Zq9WlXSwpX+kbhK h7ctjThHGAgTV7NzuGToEsPt+fI37MJugfzYay/kRXXMRq7e/ZwQHuR/qCRBl+ZPfNau WZt+MXH8GFjVj5Nuw5yXL94uEmkEeJv1UYjk2BOfi846BG1gi7VlEUxcGQrhU1jR5zDP xknw==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=UZ7E5Bo+/eE1jKOYrWOcMYFkMjRA9wTz1VirhpgCpEY=; b=lGaFgVsuT9cbAARi4W6X7x6rXgA/nWoZNUXcvhXu05IAdokdLZLsdWnhxDokD7ma21 REcRFOBTs9lLfmDwHCzoEk2t7u3lpRZuNfYX+SoF91vbR6oBxF1KQaM3bTnPDtKG5IwW uOhcHPCsfWRlWuZ2F0aYuWSV4Yie0MHc/b4Ph1piHvOs5LH02t0SpBKAB14Nn7CLO3dr 8LktSSjGGOTHFyybY1pj/zrVfsUpelIxiApVPcwBWgYIeaJ6/AEjFinxhgk8TEAZWvPJ pdDA+hWPJ8fljz/wUdTNa8fdvIFvZXcSGumt9Hj0KGSDHmvUyz39d4VSalWtpbWMupV7 6W5Q==
X-Gm-Message-State APjAAAV7Kl4s5gzGweU1o9On7yfBdxbr8ZGPEgwaDDzwL5TGjUjSmF+5 HCDlcAbtpAa8w7fjT4dXLLeXmuUUglTpkjaGajzFxGt/0UZkLw==
X-Google-Smtp-Source APXvYqz78y1D9GwegEfqfI0Cu1Rxl+Vjhj5PvUDSG76kkjTB3PUCSiPOvU0ijxzuvy5Hh6i7fUgq8tB+DMHBrj3caT4=
X-Received by 2002:a05:6808:209:: with SMTP id l9mr2339811oie.81.1568366327975; Fri, 13 Sep 2019 02:18:47 -0700 (PDT)
X-MailFrom ahmed.tahri@cloudnursery.dev
X-Mailman-Rule-Hits emergency
X-Mailman-Rule-Misses dmarc-mitigation; no-senders; approved
Message-ID-Hash SMUIUN4WHUKUPO5BBX22OCX532PIMHES
X-Message-ID-Hash SMUIUN4WHUKUPO5BBX22OCX532PIMHES
X-Mailman-Approved-At Fri, 13 Sep 2019 08:49:41 -0400
X-Content-Filtered-By Mailman/MimeDel 3.3.1
X-Mailman-Version 3.3.1
Precedence list
List-Id Announcement-only list for the Python programming language <python-announce-list.python.org>
Archived-At <https://mail.python.org/archives/list/python-announce-list@python.org/message/SMUIUN4WHUKUPO5BBX22OCX532PIMHES/>
List-Archive <https://mail.python.org/archives/list/python-announce-list@python.org/>
List-Help <mailto:python-announce-list-request@python.org?subject=help>
List-Post <mailto:python-announce-list@python.org>
List-Subscribe <mailto:python-announce-list-join@python.org>
List-Unsubscribe <mailto:python-announce-list-leave@python.org>
Xref csiph.com comp.lang.python.announce:3191

Show key headers only | View raw


There is a very old *issue* regarding "encoding detection" in a text file
that has been partially resolved by a program like Chardet
<https://github.com/chardet/chardet>. I did not like the idea of single
prober per encoding table that could lead to hard coding specifications.

I wanted to challenge the existing methods of discovering originating
encoding.

You could consider this issue as obsolete because of current norms :

You should indicate used charset encoding as described in standards

But the reality is different, a huge part of the internet still have
content with an unknown encoding. (*One could point out subrip subtitle
(SRT) for instance*)

This is why a popular package like Requests
<https://github.com/psf/Requests> embed Chardet to guess apparent encoding
on remote resources.

https://github.com/Ousret/charset_normalizer

https://pypi.org/project/charset-normalizer

Charset Normalizer <https://github.com/Ousret/charset_normalizer>. *A first
PoC. Currently at version 0.3*

The Real First Universal Charset Detector. No Cpp Bindings. (13-Sept-19)

*LICENSE MIT*

ahmed.tahri@cloudnursery.dev

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


Thread

A proof of concept to replace unreliable python chardet Ahmed TAHRI <ahmed.tahri@cloudnursery.dev> - 2019-09-13 11:18 +0200

csiph-web