replace foreach(dchar; s) loop with explicit for+range

- Using foreach (dchar; string) results in a runtime
  call to _aApplycd which is a less optimized decoding
  routine and invokes the foreach delegate for each dchar.