File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -131,8 +131,11 @@ def viml_keys(obj):
131
131
return obj .keys ()
132
132
133
133
def viml_len (obj ):
134
- if type (obj ) is str :
135
- return len (obj .encode ('utf-8' ))
134
+ try :
135
+ if type (obj ) is str :
136
+ return len (obj .encode ('utf-8' , 'ignore' ))
137
+ except UnicodeDecodeError :
138
+ pass
136
139
return len (obj )
137
140
138
141
def viml_printf (* args ):
Original file line number Diff line number Diff line change @@ -131,8 +131,11 @@ def viml_keys(obj):
131
131
return obj .keys ()
132
132
133
133
def viml_len (obj ):
134
- if type (obj ) is str :
135
- return len (obj .encode ('utf-8' ))
134
+ try :
135
+ if type (obj ) is str :
136
+ return len (obj .encode ('utf-8' , 'ignore' ))
137
+ except UnicodeDecodeError :
138
+ pass
136
139
return len (obj )
137
140
138
141
def viml_printf (* args ):
You can’t perform that action at this time.
0 commit comments