Re: IntlCharsetDetector

From: Date: Thu, 14 Apr 2016 12:43:33 +0000
Subject: Re: IntlCharsetDetector
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-92298@lists.php.net to get a copy of this message
On 4/11/16 6:11 PM, Sara Golemon wrote:
On Mon, Apr 11, 2016 at 9:36 AM, Stanislav Malyshev <smalyshev@gmail.com> wrote:
The point is even imperfect detection may be useful in certain circumstances, and detector being part of ICU hints that people find it useful enough to spend time implementing and supporting it. We should not ignore that.
Well, Stas, your informal thumbs up to the idea means enough to me to at least formalize it into an RFC even though I was previously feeling negative on it. I may yet vote no on my own RFC after the discussion period, but as you say it's worth considering the fact that someone thought it reasonable enough to actually build into ICU...
The general problem is impossible. If you constrain the question, for example as Stas says by knowing the language and choosing between a given set of codes, then you may have success. And I'm sure I'm not alone in sometimes using a simple heuristic to choose between cp1252 and utf8. But this does not logically imply that ICU CharsetDetector is a suitable solution in such cases or that it's a good API or a decent implementation. Or that PHP should expose it. An SO chat doesn't necessarily count as a feature request. I'd rather people engineered real solutions specific to their requirements than resort to any of the failed attempts to solve the general problem. Tom

« previous php.internals (#92298) next »