title: lua loops stuck after 15 numbers
body: <p>My code is designed to read digits and turn them into Chinese pinyin:</p>
  
  <pre><code>function digitconverter (digit)
      if digit == "0" then
          cnumber = "ying2 "
      elseif digit == "1" then
          cnumber = "yi1 "
      elseif digit == "2" then
          cnumber = "er2 "
      elseif digit == "3" then
          cnumber = "san1 "
      elseif digit == "4" then
          cnumber = "si4 "
      elseif digit == "5" then
          cnumber = "wu3 "
      elseif digit == "6" then
          cnumber = "liu4 "
      elseif digit == "7" then
          cnumber = "qi1 "
      elseif digit == "8" then
          cnumber = "ba1 "
      elseif digit == "9" then
          cnumber = "jiu3 "
      end
      return cnumber
  end
  
  print("Enter a number to be converted:")
  
  repeat
      strnumber = io.read("*line")
      number = tonumber(strnumber)
      if number ~= nil then
          continue = true
      else
          print("Invalid input. Please try again:")
          continue = false
      end
  until continue == true
  nlength = #strnumber
  
  digits = {}
  for d in string.gmatch(number, "%d") do
      digits[#digits + 1] = d
  end
  
  convnumber = ""
  for d=1,nlength do
      convnumber = convnumber .. digitconverter(digits[d])
  end
  print(convnumber)
  
      io.read()
  </code></pre>
  
  <p>If I enter over 15 digits, it gets stuck (for lack of a better term). It WILL convert every digit, but the 16th will be random and the 17th and on will repeat another random one. I've been over it and I can't figure out where it's getting hung up. Thoughts?</p>