~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/mail_client.py

  • Committer: Andrew Bennetts
  • Date: 2008-03-12 20:32:26 UTC
  • mto: This revision was merged to the branch mainline in revision 3756.
  • Revision ID: andrew.bennetts@canonical.com-20080312203226-m88q24tuvvk5z4zg
Fix failing tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
186
186
        :return:    encoded string if u is unicode, u itself otherwise.
187
187
        """
188
188
        if isinstance(u, unicode):
189
 
            return u.encode(bzrlib.user_encoding, 'replace')
 
189
            return u.encode(osutils.get_user_encoding(), 'replace')
190
190
        return u
191
191
 
192
192
    def _encode_path(self, path, kind):
200
200
        """
201
201
        if isinstance(path, unicode):
202
202
            try:
203
 
                return path.encode(bzrlib.user_encoding)
 
203
                return path.encode(osutils.get_user_encoding())
204
204
            except UnicodeEncodeError:
205
205
                raise errors.UnableEncodePath(path, kind)
206
206
        return path