Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert cp1251 file to utf8 #669

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions pony/converting.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# coding: cp1251

from __future__ import absolute_import, print_function

import re
Expand Down Expand Up @@ -134,15 +132,15 @@ def check_rfc2822_email(s):

month_lists = [
"jan feb mar apr may jun jul aug sep oct nov dec".split(),
u"��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ���".split(), # Russian
"янв фев мар апр май июн июл авг сен окт ноя дек".split(), # Russian
]
month_dict = {}

for month_list in month_lists:
for i, month in enumerate(month_list):
month_dict[month] = i + 1

month_dict[u'���'] = 5 # Russian
month_dict['мая'] = 5 # Russian

def str2date(s):
s = s.strip().lower()
Expand Down