Fix T71273: Bad encoding of utf-8 for Text objects
`BLI_strncpy_wchar_from_utf8` internally assumes `wchar_t` is 32 bits which is not the case on windows. The solution is to replace `wchar_t` with `char32_t`. Thanks to @robbott for compatibility on macOS. Differential Revision: https://developer.blender.org/D6198
This commit is contained in:
18
extern/wcwidth/wcwidth.h
vendored
18
extern/wcwidth/wcwidth.h
vendored
@@ -20,11 +20,19 @@
|
||||
#ifndef __WCWIDTH_H__
|
||||
#define __WCWIDTH_H__
|
||||
|
||||
#include <wchar.h>
|
||||
#ifndef __cplusplus
|
||||
# if defined(__APPLE__)
|
||||
/* The <uchar.h> standard header is missing on macOS. */
|
||||
#include <stddef.h>
|
||||
typedef unsigned int char32_t;
|
||||
# else
|
||||
# include <uchar.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
int mk_wcwidth(wchar_t ucs);
|
||||
int mk_wcswidth(const wchar_t *pwcs, size_t n);
|
||||
int mk_wcwidth_cjk(wchar_t ucs);
|
||||
int mk_wcswidth_cjk(const wchar_t *pwcs, size_t n);
|
||||
int mk_wcwidth(char32_t ucs);
|
||||
int mk_wcswidth(const char32_t *pwcs, size_t n);
|
||||
int mk_wcwidth_cjk(char32_t ucs);
|
||||
int mk_wcswidth_cjk(const char32_t *pwcs, size_t n);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user