Fix out-of-bounds writes in Classify::ReadNewCutoffs
Fix out-of-bounds writes in Classify::ReadNewCutoffs

The function did not correctly read Chinese unichars into the local
Class variable if the locale was set to de_DE.UTF-8 (or other
incompatible locales). That resulted in a wrong ClassId which was
used to write into the Cutoffs array without checking for valid bounds.

On macOS the result was a runtime error in baseapi_test (see GitHub
issue #1250):

    [ RUN      ] TesseractTest.InitConfigOnlyTest
    baseapi_test(21845,0x1134c45c0) malloc: *** error for object 0x927f96c28005e0: pointer being freed was not allocated
    baseapi_test(21845,0x1134c45c0) malloc: *** set a breakpoint in malloc_error_break to debug

Replacing sscanf by std::istringstream fixes that.
Add also an assertion to catch future out-of-bounds writes.

Signed-off-by: Stefan Weil <8d4c780fcfdc41841e5070f4c43da8958ba6aec0@weilnetz.de>

amitdo/tesseract,stweil/tesseract,stweil/tesseract,UB-Mannheim/tesseract,stweil/tesseract,amitdo/tesseract,amitdo/tesseract,UB-Mannheim/tesseract,UB-Mannheim/tesseract,tesseract-ocr/tesseract,UB-Mannheim/tesseract,tesseract-ocr/tesseract,amitdo/tesseract,tesseract-ocr/tesseract,UB-Mannheim/tesseract,tesseract-ocr/tesseract,stweil/tesseract,amitdo/tesseract,tesseract-ocr/tesseract,stweil/tesseract