diff options
author | mano-wii <germano.costa@ig.com.br> | 2019-11-22 18:26:54 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2019-11-22 18:27:34 +0300 |
commit | 177dfc6384b926dd19e3b7e98a995ccb4da9167c (patch) | |
tree | 865abe9f707bee039a506bfc17cb4cff218bd6c6 /source/blender/blenkernel/BKE_font.h | |
parent | 1304cee920c5f01fd9f0474ea782db61ac031403 (diff) |
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
Diffstat (limited to 'source/blender/blenkernel/BKE_font.h')
-rw-r--r-- | source/blender/blenkernel/BKE_font.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/blenkernel/BKE_font.h b/source/blender/blenkernel/BKE_font.h index 3dd2a551a93..1780ac9fc3e 100644 --- a/source/blender/blenkernel/BKE_font.h +++ b/source/blender/blenkernel/BKE_font.h @@ -27,8 +27,6 @@ extern "C" { #endif -#include <wchar.h> - struct CharInfo; struct Curve; struct Main; @@ -48,7 +46,7 @@ typedef struct EditFontSelBox { } EditFontSelBox; typedef struct EditFont { - wchar_t *textbuf; + char32_t *textbuf; struct CharInfo *textbufinfo; /* array of rectangles & rotation */ @@ -90,7 +88,7 @@ bool BKE_vfont_to_curve_ex(struct Object *ob, struct Curve *cu, int mode, struct ListBase *r_nubase, - const wchar_t **r_text, + const char32_t **r_text, int *r_text_len, bool *r_text_free, struct CharTrans **r_chartransdata); @@ -101,13 +99,13 @@ int BKE_vfont_select_get(struct Object *ob, int *r_start, int *r_end); void BKE_vfont_select_clamp(struct Object *ob); void BKE_vfont_clipboard_free(void); -void BKE_vfont_clipboard_set(const wchar_t *text_buf, +void BKE_vfont_clipboard_set(const char32_t *text_buf, const struct CharInfo *info_buf, const size_t len); -void BKE_vfont_clipboard_get(wchar_t **r_text_buf, +void BKE_vfont_clipboard_get(char32_t **r_text_buf, struct CharInfo **r_info_buf, size_t *r_len_utf8, - size_t *r_len_wchar); + size_t *r_len_utf32); #ifdef __cplusplus } |