args icon indicating copy to clipboard operation
args copied to clipboard

std::wstring support?

Open skyline75489 opened this issue 7 years ago • 8 comments

On Win32 the default main accepts TCHAR which could be WCHAR.

skyline75489 avatar Jun 06 '17 04:06 skyline75489

Maybe you could add typedefs for all std::string types:

#ifdef WITH_UNICODE
typedef std::wstring STRING;
typedef std::wstring::npos STRING_NPOS;
typedef std::wstring::size_type STRING_SIZE_TYPE;
#else
typedef std::string STRING;
typedef std::string::npos STRING_NPOS;
typedef std::string::size_type STRING_SIZE_TYPE;
#endif

darealshinji avatar Sep 01 '18 17:09 darealshinji

wchar support would be quite handy

TheOneRing avatar Feb 17 '19 09:02 TheOneRing

It's not a bad idea. It would possibly be better to take in the string type as a template, to also allow for other string types (particularly utf-8 types), but that could add more noise and template complexity. I'm not against a typedef like this, though it is backwards-incompatible.

Taywee avatar Feb 17 '19 14:02 Taywee

Is that a "I'm looking into it" or a "I'm waiting for contribution"? ;D

TheOneRing avatar Feb 27 '19 14:02 TheOneRing

More of a "I was looking into it, but the templates got ugly and unmaintainable, and I never returned to it". I'd be more than happy to accept a reasonable pull request, otherwise I can get to it sometime in the next few weeks when I have a free evening. I'd probably just stick to the typedef style.

Taywee avatar Feb 27 '19 16:02 Taywee

Good to hear :)

TheOneRing avatar Feb 27 '19 18:02 TheOneRing

ping :)

TheOneRing avatar May 23 '19 14:05 TheOneRing

ping 😃

parzival3 avatar Mar 27 '20 10:03 parzival3