Index: django/db/models/base.py
===================================================================
--- django/db/models/base.py	(wersja 6193)
+++ django/db/models/base.py	(kopia robocza)
@@ -12,7 +12,7 @@
 from django.dispatch import dispatcher
 from django.utils.datastructures import SortedDict
 from django.utils.functional import curry
-from django.utils.encoding import smart_str, force_unicode
+from django.utils.encoding import smart_str, force_unicode, smart_unicode
 from django.conf import settings
 from itertools import izip
 import types
@@ -213,7 +213,7 @@
         pk_val = self._get_pk_val()
         # Note: the comparison with '' is required for compatibility with
         # oldforms-style model creation.
-        pk_set = pk_val is not None and pk_val != u''
+        pk_set = pk_val is not None and smart_unicode(pk_val) != u''
         record_exists = True
         if pk_set:
             # Determine whether a record with the primary key already exists.
Index: tests/modeltests/custom_pk/models.py
===================================================================
--- tests/modeltests/custom_pk/models.py	(wersja 6193)
+++ tests/modeltests/custom_pk/models.py	(kopia robocza)
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 """
 14. Using a custom primary key
 
@@ -92,4 +93,8 @@
 >>> Business.objects.filter(employees__first_name__startswith='Fran')
 [<Business: Sears>]
 
+# Primary key may be unicode string
+>>> emp = Employee(employee_code='jaźń')
+>>> emp.save()
+
 """}
