Skip to content
Myr

cp949prover for charade

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent a554828 · Browse files · 1 file+44 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+44 added−0 removed

  • other:+44 added−0 removed

1 file+44 added−0 removed

added:requests/packages/charade/cp949prober.py+44 added
1######################## BEGIN LICENSE BLOCK ########################2# The Original Code is mozilla.org code.3#4# The Initial Developer of the Original Code is5# Netscape Communications Corporation.6# Portions created by the Initial Developer are Copyright (C) 19987# the Initial Developer. All Rights Reserved.8#9# Contributor(s):10# Mark Pilgrim - port to Python11#12# This library is free software; you can redistribute it and/or13# modify it under the terms of the GNU Lesser General Public14# License as published by the Free Software Foundation; either15# version 2.1 of the License, or (at your option) any later version.16#17# This library is distributed in the hope that it will be useful,18# but WITHOUT ANY WARRANTY; without even the implied warranty of19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU20# Lesser General Public License for more details.21#22# You should have received a copy of the GNU Lesser General Public23# License along with this library; if not, write to the Free Software24# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA25# 02110-1301 USA26######################### END LICENSE BLOCK #########################2728from .mbcharsetprober import MultiByteCharSetProber29from .codingstatemachine import CodingStateMachine30from .chardistribution import EUCKRDistributionAnalysis31from .mbcssm import CP949SMModel323334class CP949Prober(MultiByteCharSetProber):35 def __init__(self):36 MultiByteCharSetProber.__init__(self)37 self._mCodingSM = CodingStateMachine(CP949SMModel)38 # NOTE: CP949 is a superset of EUC-KR, so the distribution should be39 # not different.40 self._mDistributionAnalyzer = EUCKRDistributionAnalysis()41 self.reset()4243 def get_charset_name(self):44 return "CP949"