Blender
V4.5
intern
utfconv
utfconv.hh
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2012 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9
#ifndef __UTFCONV_H__
10
#define __UTFCONV_H__
11
12
#include <cstdio>
13
#include <cstdlib>
14
#include <cwchar>
15
21
size_t
count_utf_8_from_16
(
const
wchar_t
*string16);
22
28
size_t
count_utf_16_from_8
(
const
char
*string8);
29
30
/*
31
* conv_utf_*** errors
32
*/
33
35
#define UTF_ERROR_NULL_IN (1 << 0)
37
#define UTF_ERROR_ILLCHAR (1 << 1)
39
#define UTF_ERROR_SMALL (1 << 2)
41
#define UTF_ERROR_ILLSEQ (1 << 3)
42
50
int
conv_utf_16_to_8
(
const
wchar_t
*in16,
char
*out8,
size_t
size8);
51
59
int
conv_utf_8_to_16
(
const
char
*in8,
wchar_t
*out16,
size_t
size16);
60
67
char
*
alloc_utf_8_from_16
(
const
wchar_t
*in16,
size_t
add
);
68
76
wchar_t
*
alloc_utf16_from_8
(
const
char
*in8,
size_t
add
);
77
78
/* Easy allocation and conversion of new utf-16 string. New string has _16 suffix.
79
* Must be deallocated with UTF16_UN_ENCODE in right order. */
80
#define UTF16_ENCODE(in8str) \
81
if (1) { \
82
wchar_t *in8str##_16 = alloc_utf16_from_8((const char *)in8str, 0)
83
84
#define UTF16_UN_ENCODE(in8str) \
85
free(in8str##_16); \
86
} \
87
(void)0
88
89
#endif
/* __UTFCONV_H__ */
add
static void add(btAlignedObjectArray< T > &items, const Q &value)
Definition
btSoftBodyHelpers.cpp:110
alloc_utf16_from_8
wchar_t * alloc_utf16_from_8(const char *in8, size_t add)
Definition
utfconv.cc:292
count_utf_8_from_16
size_t count_utf_8_from_16(const wchar_t *string16)
Definition
utfconv.cc:11
alloc_utf_8_from_16
char * alloc_utf_8_from_16(const wchar_t *in16, size_t add)
Definition
utfconv.cc:280
conv_utf_8_to_16
int conv_utf_8_to_16(const char *in8, wchar_t *out16, size_t size16)
Definition
utfconv.cc:182
conv_utf_16_to_8
int conv_utf_16_to_8(const wchar_t *in16, char *out8, size_t size8)
Definition
utfconv.cc:116
count_utf_16_from_8
size_t count_utf_16_from_8(const char *string8)
Definition
utfconv.cc:58
Generated on
for Blender by
doxygen
1.18.0