<commit_before>import gzip
import io

import mock

import cherrypy
from cherrypy._cpcompat import IncompleteRead, ntob, ntou

europoundUnicode = ntou(r'\x00\xa3')
sing = ntou("\u6bdb\u6cfd\u4e1c: Sing, Little Birdie?", 'escape')
sing8 = sing.encode('utf-8')
sing16 = sing.encode('utf-16')


from cherrypy.test import helper


class EncodingTests(helper.CPWebCase):

    def setup_server():
        class Root:

            @cherrypy.expose
            def index(self, param):
                assert param == europoundUnicode, "%r != %r" % (
                    param, europoundUnicode)
                yield europoundUnicode
<commit_msg>Replace ugly escapes and broken manual encodes with proper characters, encoded as UTF-8 in the code. Breaks test_query_string_decoding on Python 3. Ref #1443.<commit_after># coding: utf-8

import gzip
import io

import mock

import cherrypy
from cherrypy._cpcompat import IncompleteRead, ntob, ntou

europoundUnicode = ntou('£', encoding='utf-8')
sing = ntou("毛泽东: Sing, Little Birdie?", encoding='utf-8')

sing8 = sing.encode('utf-8')
sing16 = sing.encode('utf-16')


from cherrypy.test import helper


class EncodingTests(helper.CPWebCase):

    def setup_server():
        class Root:

            @cherrypy.expose
            def index(self, param):
                assert param == europoundUnicode, "%r != %r" % (
                    param, europoundUnicode)
                yield europoundUnicode

{'fraction_non_alphanumeric': 0.10416666666666667, 'fraction_numerical': 0.019444444444444445, 'mean_word_length': 2.947945205479452, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5806354', 'n_tokens_mistral': 475, 'n_tokens_neox': 442, 'n_words': 124}