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

note on string literal size and double quotes #1

Open
btsimonh opened this issue Jul 18, 2017 · 2 comments
Open

note on string literal size and double quotes #1

btsimonh opened this issue Jul 18, 2017 · 2 comments

Comments

@btsimonh
Copy link

Just found this and love it.
But... note that MS limits string literals to 16384 (from https://stackoverflow.com/questions/16868362/c-string-too-big-trailing-characters-truncated).
Also, this construct in js inside an html foxed it:
index = index ? index[1].replace(/"/g, '"') : '';

  • error was 'error C2001: newline in constant' (vs 2015).
@apolukhin
Copy link
Owner

Thanks! I thought I'm the only one who liked it :)

Probably there's a way to fix one of those limitations by using raw string literals. Are you interested in such fix? Do you use C++11?

@btsimonh
Copy link
Author

I'm using c++11 capable compiler, but quite conservative with what I use.. so not really genned up on what c++11 adds :). What may this involve?

I'm actually considering how I 'protect' the html/js; although at the end of the day, it's going to be loaded into a browser, so can't be 'protected'; however it may mean I at least have a build step involved which will minify/uglify the js.
It's funny how a search for 'how to embed html inside a c application' is so hard to do; I spend at least 2 hours googling and came up blank - maybe this is why your's has not been found easily - EVERY webpage contains the word 'html' !!!

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