lib/tw/client/helper.rb in tw-1.2.1 vs lib/tw/client/helper.rb in tw-1.3.0
- old
+ new
@@ -1,9 +1,9 @@
class String
def char_length
- self.split(//u).size
+ self.split(//u).map{|i| i.bytes.length > 1 ? 2 : 1}.reduce(:+)
end
def char_length_with_t_co
Tw::Conf.update_twitter_config
len = self.char_length