Page MenuHome

windows multibyte patch.
Closed, ArchivedPublicPATCH

Description

Group: Unstable (example)

hello.

It is a patch that compels an internal character string to UTF-8.

Unfortunately, WIN32 ANSI API(not unicode) for Japanese treats the filepath with ShiftJIS(CP932). Therefore, the filepath obtained from the system cannot be correctly displayed.
(ss01.png)
Perhaps, I think that there is a similar problem in Windows other than English.
The purpose is to pass FTGL the character string that is not char*(utf-8) or wchar_t*(unicode).

OS | file system encoding | internal encoding |
| | (FTGL input) |
------------+----------------------+-------------------+------------------
X11 | ascii/UTF-8 | ascii/UTF-8 | no problem
Windows(ja) | ShiftJIS(cp932) | ShiftJIS(cp932) | corrupted string
this patch | ShiftJIS(cp932) | UTF-8 | fixed

[The main content of change]
*convert to utf-8 to CP_OEMCP before below funtions
SetWindowText
av_open_input_file(ffmpeg)

・convert to CP_OEMCP to utf-8 after below functions
FindFirstFile
FindNextFile
SHGetSpecialFolderPath

・add conversion in below functions
opendir
readdir
IMB_saveiff
open_avi_codec_file

・add truetype font drawing
Video Seqence Editor
File Browser
Image Browser

・added wrapper functions
gzFile BLI_gzopen(const char *utf8, const char *mode);
int BLI_chdir(const char *utf8);
int BLI_stat(const char *utf8, struct stat *s);
FILE* BLI_fopen(const char *utf8, const char *mode);
int BLI_open(const char *utf8, int flags, int mode);
int BLI_exists(char *utf8);

・added utility functions for UTF-8
int BLI_utf8_get_last_char_index(const char *utf8);
int BLI_utf8_get_char_culumns(const char *utf8);
int BLI_utf8_width(const char* utf8);
int BLI_utf8_get_char_bytes(const char *utf8);
void BLI_utf8_drop_a_char(char *utf8);
void BLI_utf8_replace_last_chars_with(char *utf8, const char *replace);

It uses it in long patch.
Thank you.

Event Timeline

Bastien Montagne (mont29) changed the task status from Unknown Status to Unknown Status.Aug 10 2014, 12:50 PM
Bastien Montagne (mont29) claimed this task.

We are now supporting fully utf8, time to archive! :)