@@ -1981,6 +1981,80 @@ 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*: The difference from [jerry_create_string](#jerry_create_string) is that it accepts utf-8 string instead of cesu-8 string.
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
+ *Note*: The difference from [jerry_create_string_sz](#jerry_create_string_sz) is that it accepts utf-8 string instead of cesu-8 string.
2027
+
2028
+ **Prototype**
2029
+
2030
+ ```c
2031
+ jerry_value_t
2032
+ jerry_create_string_sz (const jerry_char_t *str_p,
2033
+ jerry_size_t str_size)
2034
+ ```
2035
+
2036
+ - `str_p` - pointer to string
2037
+ - `str_size` - size of the string
2038
+ - return value - value of the created string
2039
+
2040
+ **Example**
2041
+
2042
+ ```c
2043
+ {
2044
+ const jerry_char_t char_array[] = "a string";
2045
+ jerry_value_t string_value = jerry_create_string_sz_from_utf8 (char_array,
2046
+ strlen ((const char *) char_array));
2047
+
2048
+ ... // usage of string_value
2049
+
2050
+ jerry_release_value (string_value);
2051
+ }
2052
+
2053
+ ```
2054
+
2055
+ **See also**
2056
+
2057
+ - [jerry_create_string_from_utf8](#jerry_create_string_from_utf8)
1984
2058
1985
2059
## jerry_create_undefined
1986
2060
0 commit comments