window: Optimize byte->char index conversion per Per Hedbor's suggestion - thanks!