opencv: patch for encoding issues

Closes #18801.