Repository: opencv
Issue: Unicode Build issues with system.cpp (MSVC / VS) 
Labels: bug,duplicate,category: build/install,platform: win32,category: 3rdparty

### System Information

## wchar_t issues 
Building with UNICODE. Wchar issues with ```build\opencv\modules\core\src\system.cpp```

Building with:``` -DUNICODE -D_UNICODE ```



### Detailed description

```
D:\a\apothecary\apothecary\apothecary\build\opencv\modules\core\src\trace.cpp(211,46): error C2664: '__itt_domain *(const wchar_t *)': cannot convert argument 1 from 'const char [12]' to 'const wchar_t *' [D:\a\apothecary\apothecary\apothecary\build\opencv\build_vs_ARM64\modules\core\opencv_core.vcxproj]
D:\a\apothecary\apothecary\apothecary\build\opencv\modules\core\src\trace.cpp(241,61): error C2664: '__itt_string_handle *(const wchar_t *)': cannot convert argument 1 from 'const char *const ' to 'const wchar_t *' [D:\a\apothecary\apothecary\apothecary\build\opencv\build_vs_ARM64\modules\core\opencv_core.vcxproj]
D:\a\apothecary\apothecary\apothecary\build\opencv\modules\core\src\trace.cpp(242,65): error C2664: '__itt_string_handle *(const wchar_t *)': cannot convert argument 1 from 'const char *const ' to 'const wchar_t *' [D:\a\apothecary\apothecary\apothecary\build\opencv\build_vs_ARM64\modules\core\opencv_core.vcxproj]
D:\a\apothecary\apothecary\apothecary\build\opencv\modules\core\src\trace.cpp(353,13): error C2664: '__itt_string_handle *(const wchar_t *)': cannot convert argument 1 from 'const char [22]' to 'const wchar_t *' [D:\a\apothecary\apothecary\apothecary\build\opencv\build_vs_ARM64\modules\core\opencv_core.vcxproj]
D:\a\apothecary\apothecary\apothecary\build\opencv\modules\core\src\trace.cpp(853,9): error C2664: '__itt_string_handle *(const wchar_t *)': cannot convert argument 1 from 'const char [12]' to 'const wchar_t *' [D:\a\apothecary\apothecary\apothecary\build\opencv\build_vs_ARM64\modules\core\opencv_core.vcxproj]
D:\a\apothecary\apothecary\apothecary\build\opencv\modules\core\src\trace.cpp(1042,60): error C2664: '__itt_string_handle *(const wchar_t *)': cannot convert argument 1 from 'const char *const ' to 'const wchar_t *' [D:\a\apothecary\apothecary\apothecary\build\opencv\build_vs_ARM64\modules\core\opencv_core.vcxproj]
D:\a\apothecary\apothecary\apothecary\build\opencv\modules\core\src\trace.cpp(1077,9): error C2664: 'void (const __itt_domain *,__itt_id,__itt_string_handle *,const wchar_t *,size_t)': cannot convert argument 4 from 'const char *' to 'const wchar_t *' [D:\a\apothecary\apothecary\apothecary\build\opencv\build_vs_ARM64\modules\core\opencv_core.vcxproj]
  logtagconfigparser.cpp
  logtagmanager.cpp
D:\a\apothecary\apothecary\apothecary\build\opencv\modules\core\src\utils\filesystem.cpp(442,21): error C2664: 'DWORD GetTempPathW(DWORD,LPWSTR)': cannot convert argument 2 from 'char [261]' to 'LPWSTR' [D:\a\apothecary\apothecary\apothecary\build\opencv\build_vs_ARM64\modules\core\opencv_core.vcxproj]
  samples.cpp
  va_intel.cpp
  opencl_kernels_core.cpp
D:\a\apothecary\apothecary\apothecary\build\opencv\modules\core\src\system.cpp(2149,76): error C2664: 'void (const wchar_t *)': cannot convert argument 1 from 'const _Elem *' to 'const wchar_t *' [D:\a\apothecary\apothecary\apothecary\build\opencv\build_vs_ARM64\modules\core\opencv_core.vcxproj]
D:\a\apothecary\apothecary\apothecary\build\opencv\modules\core\src\system.cpp(2149,76): error C2664:         with [D:\a\apothecary\apothecary\apothecary\build\opencv\build_vs_ARM64\modules\core\opencv_core.vcxproj]
D:\a\apothecary\apothecary\apothecary\build\opencv\modules\core\src\system.cpp(2149,76): error C2664:         [ [D:\a\apothecary\apothecary\apothecary\build\opencv\build_vs_ARM64\modules\core\opencv_core.vcxproj]
D:\a\apothecary\apothecary\apothecary\build\opencv\modules\core\src\system.cpp(2149,76): error C2664:             _Elem=char [D:\a\apothecary\apothecary\apothecary\build\opencv\build_vs_ARM64\modules\core\opencv_core.vcxproj]
D:\a\apothecary\apothecary\apothecary\build\opencv\modules\core\src\system.cpp(2149,76): error C2664:         ] [D:\a\apothecary\apothecary\apothecary\build\opencv\build_vs_ARM64\modules\core\opencv_core.vcxproj]
  Building Custom Rule D:/a/apothecary/apothecary/apothecary/build/opencv/3rdparty/protobuf/CMakeLists.txt
  ```
  

### Steps to reproduce

Build with unicode enabled for VS / windows C++17 / C++23 / C++20 


https://github.com/openframeworks/apothecary/actions/runs/10113822577/job/27971046816

### Issue submission checklist

- [X] I report the issue, it's not a question
- [X] I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
- [X] I updated to the latest OpenCV version and the issue is still there
- [X] There is reproducer code and related data files (videos, images, onnx, etc)