Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std::wstring support? #23

Open
skyline75489 opened this issue Jun 6, 2017 · 8 comments
Open

std::wstring support? #23

skyline75489 opened this issue Jun 6, 2017 · 8 comments

Comments

@skyline75489
Copy link

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

@darealshinji
Copy link
Contributor

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

@TheOneRing
Copy link

wchar support would be quite handy

@Taywee
Copy link
Owner

Taywee commented Feb 17, 2019

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.

@TheOneRing
Copy link

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

@Taywee
Copy link
Owner

Taywee commented Feb 27, 2019

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.

@TheOneRing
Copy link

Good to hear :)

@TheOneRing
Copy link

ping :)

@parzival3
Copy link

ping 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants