JuliaLang/julia — pull request #7249 by stevengj (2014-06-13 15:48:23+00:00)
Title: fix #7248: throw boundserror for invalid indices in ind2chr/chr2ind

Fixes #7248. Previously, `chr2ind` and `ind2chr` performed no bounds checking for `DirectIndexString`s. Now they throw a `BoundsError`.

Also, for other string types `chr2ind(s, i)` threw a `BoundsError` for `i` too large but silently returned the value for `i < 1`. I don't understand why this behavior was desirable, so I changed it to throw a `BoundsError` in both cases.