Skip to content

Commit

Permalink
Merge c8b05f7 into 765362f
Browse files Browse the repository at this point in the history
  • Loading branch information
danimaribeiro committed Mar 17, 2017
2 parents 765362f + c8b05f7 commit 295b046
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cnab240/registro.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

import os
import json
import unicodedata

from glob import iglob
from decimal import Decimal, InvalidOperation
Expand Down Expand Up @@ -83,8 +84,10 @@ def __unicode__(self):
chars_faltantes = self.digitos - len(valor)
return (u'0' * chars_faltantes) + valor
else:
chars_faltantes = self.digitos - len(self.valor)
return self.valor + (u' ' * chars_faltantes)
valor = unicodedata.normalize('NFKD', unicode(self.valor))
valor = valor.encode('ascii', 'ignore')
chars_faltantes = self.digitos - len(valor)
return valor + (u' ' * chars_faltantes)

return u'{0:0{1}d}'.format(self.valor, self.digitos)

Expand Down

0 comments on commit 295b046

Please sign in to comment.