1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-21 19:33:03 +04:00
Files
Mulham Fetna 5dbfbcdcac Merge pull request #28935 from molhamfetnah:fix/21960-unicode-temp-path
core: fix Unicode temp path handling on Windows (fix #21960) #28935

## Summary

Fixes getCacheDirectoryForDownloads and related temp file functions failing when the user home directory contains Unicode characters like C:\\Users\\テスト\\AppData\\Local\\Temp.

## Root Cause

On Windows, OpenCV was using ANSI versions of GetTempPath and GetTempFileName which fail with Unicode paths.

## Fix

Replace with wide-character GetTempPathW plus UTF-8 conversion:

- modules/core/src/utils/filesystem.cpp - getCacheDirectory for cache paths
- modules/core/src/system.cpp - temporary file creation  
- modules/ts/src/ts_gtest.cpp - test stream capture

## Testing

The fix has been verified compiles. Manual testing on Windows with Unicode username required.

## Risk

Low: Uses same output format, just different encoding path. Existing ASCII functionality preserved.

---

Fixes opencv/opencv#21960
2026-06-28 14:20:45 +03:00
..
2024-12-18 05:27:10 +08:00
2025-02-27 14:24:18 +08:00