Skip to content

Add API documentation for create string from a valid UTF8 string functions. #1444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

robertsipka
Copy link
Contributor

No description provided.

@robertsipka robertsipka force-pushed the api_utf8_documentation branch from 49facac to c29006e Compare November 21, 2016 14:14

Create string from a valid UTF8 string.

*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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The difference from ... is that it accepts utf-8 string instead of cesu-8 string.

@@ -339,6 +339,13 @@ main (void)
TEST_ASSERT (sz == 0);
jerry_release_value (args[0]);

// Test create_jerry_string_from_utf8 with 4-byte long unicode sequences
args[0] = jerry_create_string_from_utf8 ((jerry_char_t *) "𝔡𝔢𝔣𝔤");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer for using \x.. byte sequence instead of real characters (since you don't know the character code of these characters). A four byte long sequence should be part of it as well.

@robertsipka robertsipka force-pushed the api_utf8_documentation branch from c29006e to 1d2bd8a Compare November 22, 2016 11:32
…ate_string_sz_from_utf8 functions.

JerryScript-DCO-1.0-Signed-off-by: Robert Sipka [email protected]
@robertsipka robertsipka force-pushed the api_utf8_documentation branch from 1d2bd8a to b4bb2ef Compare November 22, 2016 11:47
@robertsipka
Copy link
Contributor Author

Thanks, I've updated this patch.

@zherczeg
Copy link
Member

LGTM

1 similar comment
@LaszloLango
Copy link
Contributor

LGTM

@yichoi yichoi merged commit 97303eb into jerryscript-project:master Nov 23, 2016
@robertsipka robertsipka deleted the api_utf8_documentation branch November 24, 2016 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants