diff --git a/rq/compat/__init__.py b/rq/compat/__init__.py index 9ce6e4e..ac9b7a9 100644 --- a/rq/compat/__init__.py +++ b/rq/compat/__init__.py @@ -61,7 +61,7 @@ else: if v is None: return None elif isinstance(v, bytes): - return v.decode('ascii') + return v.decode('utf-8') elif isinstance(v, str): return v else: diff --git a/rq/job.py b/rq/job.py index 6bf9189..42653e0 100644 --- a/rq/job.py +++ b/rq/job.py @@ -210,7 +210,7 @@ class Job(object): @classmethod def key_for(cls, job_id): """The Redis key that is used to store job hash under.""" - return b'rq:job:' + job_id.encode('ascii') + return b'rq:job:' + job_id.encode('utf-8') @property def key(self): diff --git a/tests/test_job.py b/tests/test_job.py index 522f1a6..0f376ec 100644 --- a/tests/test_job.py +++ b/tests/test_job.py @@ -108,7 +108,7 @@ class TestJob(RQTestCase): job.save() expected_date = strip_milliseconds(job.created_at) - stored_date = self.testconn.hget(job.key, 'created_at').decode('ascii') + stored_date = self.testconn.hget(job.key, 'created_at').decode('utf-8') self.assertEquals( times.to_universal(stored_date), expected_date) @@ -124,7 +124,7 @@ class TestJob(RQTestCase): job.save() expected_date = strip_milliseconds(job.created_at) - stored_date = self.testconn.hget(job.key, 'created_at').decode('ascii') + stored_date = self.testconn.hget(job.key, 'created_at').decode('utf-8') self.assertEquals( times.to_universal(stored_date), expected_date)