Navigation Menu

Skip to content
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

Use locale for path #17

Merged
merged 1 commit into from Jun 27, 2018
Merged

Use locale for path #17

merged 1 commit into from Jun 27, 2018

Conversation

kou
Copy link
Contributor

@kou kou commented Jun 26, 2018

Because the recent mruby accepts UTF-8 string as path and converts the
UTF-8 string to locale string internally. This change uses the same
logic.

See also: https://github.com/mruby/mruby/blob/fb9358206e29c8b018b3b8553e96bf35eb9a4a63/mrbgems/mruby-io/src/io.c#L758

kou added a commit to groonga/groonga that referenced this pull request Jun 26, 2018
We should use ksss/mruby-file-stat again when
ksss/mruby-file-stat#17 is merged.
char *locale_path;
int stat_result;

locale_path = mrb_locale_from_utf8(path, -1);
Copy link
Owner

Choose a reason for hiding this comment

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

Is not mrb_locale_free(locale_path) necessary?

Copy link
Contributor Author

@kou kou Jun 26, 2018

Choose a reason for hiding this comment

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

Oh, it's needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added it.

Because the recent mruby accepts UTF-8 string as path and converts the
UTF-8 string to locale string internally. This change uses the same
logic.

See also: https://github.com/mruby/mruby/blob/fb9358206e29c8b018b3b8553e96bf35eb9a4a63/mrbgems/mruby-io/src/io.c#L758
@ksss
Copy link
Owner

ksss commented Jun 27, 2018

Thanks!

@ksss ksss merged commit 1287158 into ksss:master Jun 27, 2018
@kou kou deleted the use-locale-for-path branch June 27, 2018 03:06
kou added a commit to groonga/groonga that referenced this pull request Jun 27, 2018
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.

None yet

2 participants