-
-
Notifications
You must be signed in to change notification settings - Fork 490
Expand file tree
/
Copy pathtest_encoding.cc
More file actions
26 lines (21 loc) · 847 Bytes
/
test_encoding.cc
File metadata and controls
26 lines (21 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* test_encoding.cc - Test string encoding
part of the minizip-ng project
Copyright (C) Nathan Moinvaziri
https://github.com/zlib-ng/minizip-ng
This program is distributed under the terms of the same license as zlib.
See the accompanying LICENSE file for the full text of the license.
*/
#include "mz.h"
#include "mz_os.h"
#include <gtest/gtest.h>
TEST(os, utf8_unicode_string) {
const char *test_string = "Heiz�lr�cksto�abd�mpfung";
char *utf8_string = mz_os_utf8_string_create(test_string, MZ_ENCODING_CODEPAGE_950);
ASSERT_NE(utf8_string, nullptr);
#if defined(_WIN32)
wchar_t *unicode_string = mz_os_unicode_string_create(utf8_string, MZ_ENCODING_UTF8);
ASSERT_NE(unicode_string, nullptr);
mz_os_unicode_string_delete(&unicode_string);
#endif
mz_os_utf8_string_delete(&utf8_string);
}