Skip to content

Conversation

@MarekKnapek
Copy link
Contributor

No description provided.

@rexim
Copy link
Member

rexim commented Jan 21, 2026

@rexim rexim closed this Jan 21, 2026
@KillerxDBr
Copy link
Contributor

In case this get reopen, i recoment change the defines at lines 159 to 163 as i explained at #202 (comment)

#    define _WINUSER_
#    define _WINGDI_
#    define _IMM_
#    define _WINCON_

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);
Copy link
Contributor

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
Copy link
Contributor

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

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

Successfully merging this pull request may close these issues.

3 participants