@@ -1981,6 +1981,78 @@ jerry_create_string_sz (const jerry_char_t *str_p,
1981
1981
1982
1982
- [jerry_create_string](#jerry_create_string)
1983
1983
1984
+ ## jerry_create_string_from_utf8
1985
+
1986
+ **Summary**
1987
+
1988
+ Create string from a valid UTF8 string.
1989
+
1990
+ *Note*: It differs from [jerry_create_string](#jerry_create_string) function in this converts all 4-bytes long unicode sequences into two 3-bytes long sequences.
1991
+
1992
+ **Prototype**
1993
+
1994
+ ```c
1995
+ jerry_value_t
1996
+ jerry_create_string_from_utf8 (const jerry_char_t *str_p);
1997
+ ```
1998
+
1999
+ - `str_p` - pointer to string
2000
+ - return value - value of the created string
2001
+
2002
+ **Example**
2003
+
2004
+ ```c
2005
+ {
2006
+ const jerry_char_t char_array[] = "a string";
2007
+ jerry_value_t string_value = jerry_create_string_from_utf8 (char_array);
2008
+
2009
+ ... // usage of string_value
2010
+
2011
+ jerry_release_value (string_value);
2012
+ }
2013
+ ```
2014
+
2015
+ **See also**
2016
+
2017
+ - [jerry_create_string_sz_from_utf8](#jerry_create_string_sz_from_utf8)
2018
+
2019
+
2020
+ ## jerry_create_string_sz_from_utf8
2021
+
2022
+ **Summary**
2023
+
2024
+ Create string from a valid UTF8 string.
2025
+
2026
+ **Prototype**
2027
+
2028
+ ```c
2029
+ jerry_value_t
2030
+ jerry_create_string_sz (const jerry_char_t *str_p,
2031
+ jerry_size_t str_size)
2032
+ ```
2033
+
2034
+ - `str_p` - pointer to string
2035
+ - `str_size` - size of the string
2036
+ - return value - value of the created string
2037
+
2038
+ **Example**
2039
+
2040
+ ```c
2041
+ {
2042
+ const jerry_char_t char_array[] = "a string";
2043
+ jerry_value_t string_value = jerry_create_string_sz_from_utf8 (char_array,
2044
+ strlen ((const char *) char_array));
2045
+
2046
+ ... // usage of string_value
2047
+
2048
+ jerry_release_value (string_value);
2049
+ }
2050
+
2051
+ ```
2052
+
2053
+ **See also**
2054
+
2055
+ - [jerry_create_string_from_utf8](#jerry_create_string_from_utf8)
1984
2056
1985
2057
## jerry_create_undefined
1986
2058
0 commit comments