-
Notifications
You must be signed in to change notification settings - Fork 158
Fix Unicode UTF-8 does not work in Windows console. #187 #198
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
Conversation
Allow other processes to read from or delete the same file while we have it currently opened for reading. Allow current process to open file for reading while other processes have this file already opened for reading and are sharing this file for reading.
99ac627 to
0db3cc9
Compare
|
In case this get reopen, i recoment change the defines at lines 159 to 163 as i explained at #202 (comment) |
| NOB_ASSERT(narrow_str); | ||
| NOB_ASSERT(narrow_capacity >= 1); | ||
|
|
||
| narrow_len = WideCharToMultiByte(CP_UTF8, 0, wide_str, wide_len, narrow_str, narrow_capacity, NULL, NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add flags WC_ERR_INVALID_CHARS | WC_NO_BEST_FIT_CHARS and maybe check error (narrow_len == 0)?
|
|
||
| NOBDEF bool nob_read_entire_file(const char *path, Nob_String_Builder *sb) | ||
| { | ||
| #ifdef _WIN32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't it be more maintainable to use _wfopen instead of rewritting the entire function? with a small ifdef, just to convert to UTF16 and reuse the rest of the function, making it easier if something change in the future
No description provided.