code: def unicode_left(s, width):
      
      i = 0
      j = 0
      for ch in s:
          j += __unicode_width_mapping[east_asian_width(ch)]
          if width < j:
              break
          i += 1
      return s[:i]
docs: Cut unicode string from left to fit a given width.