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

Example using Unicode strings and real C++ code? #23

Open
patlecat opened this issue Oct 13, 2021 · 3 comments
Open

Example using Unicode strings and real C++ code? #23

patlecat opened this issue Oct 13, 2021 · 3 comments

Comments

@patlecat
Copy link

It would be helpful to have an example of a generic C++ use of strings with STL that can run under Windows and Linux. The examples now are very specific to compiler vendors only, I don't see this as an advantage, especially for a C++ user.
Also I find the mislabelling of C code as "C++" not appropriate.

@superflexible
Copy link
Owner

superflexible commented Oct 13, 2021

Hello,
OK ... what does generic mean, or which compiler should I do it with?

Maybe one or two files would work as pure C code but currently use the cpp extension. I don't intend to change that. The project description says that there are C++ bindings and that is true.

@patlecat
Copy link
Author

Generic means standard CPP as per the ISO definition so C++17 for example that will run on most modern day compilers.

I could not see any C++ code apart from std::cout in the examples, where are those C++ example files and where is that C++ extension that you talk about I could not find it?

@superflexible
Copy link
Owner

Hello,
this is the C++ class that has the best chance to be converted to completely generic C++:
https://github.com/superflexible/TGPuttyLib/blob/master/tgputtylibvcclass.h
https://github.com/superflexible/TGPuttyLib/blob/master/tgputtylibvcclass.cpp

It's not Unicode however. You need to call your favorite UTF8 encode/decode functions for every string you pass or get to this class.

Feel free to fork and contribute via pull requests, if you like. Maybe one day I can make a generic Unicode class that's not compiler specific.

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

2 participants