Skip to content

Supply imwrite/imread overloads to work with wstring, wchar_t  #5631

@comdiv

Description

@comdiv

In our project we use wide strings (std::wstring + wchar_t* ) by default - so it's more compatible to file names with locale symbols (cyr) and it's easy to integrate with .NET marshalling.

In our OpenCV code we use something like this:

    void load(wstring filename){
        Mat img = imread(string(filename.begin(), filename.end()), CV_LOAD_UNCHANGED);
    } 
   void load(wchar_t* filename){
    wstring wfname(filename);
        Mat img = imread(string(wfname.begin(), wfname.end()), CV_LOAD_UNCHANGED);
    } 

Our suggestion - supply overloads (or template) for imread/imwrite to use std::wstring, wchar_t*

Better if in nuts it will be wide char based, and std::string version - as overload.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions