getCaretLocation() issue for non-Roman scripts (fixes #2934)