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

Make it possible to save as UTF-8 #4

Closed
jberkel opened this issue Aug 31, 2016 · 2 comments
Closed

Make it possible to save as UTF-8 #4

jberkel opened this issue Aug 31, 2016 · 2 comments

Comments

@jberkel
Copy link

jberkel commented Aug 31, 2016

Looks like Apple now recommends the use of UTF-8 for string files:

It is recommended that you save strings files using the UTF-8 encoding, which is the default encoding for standard strings files. Xcode automatically transcodes strings files from UTF-8 to UTF-16 when they’re copied into the product.

https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html

Maybe just expose the encoding parameter in the outer save() method while keeping the current default?

def save(self, output_filename, encoding='utf16'):
   with io.open(output_filename, encoding=encoding, mode='w') as f:
@dulacp
Copy link
Owner

dulacp commented Sep 20, 2016

Thanks for the heads-up! Nice they are changing their recommendation ^^
I will add new tests with that in mind, authorizing for both encoding to be supported

@dulacp dulacp closed this as completed in 2c6a3c2 Sep 20, 2016
@dulacp
Copy link
Owner

dulacp commented Sep 20, 2016

I bumped a new version with the fix 1.1.0.
Thanks for bringing that to my attention.

Now the tool only support utf-8 encoding, which also plays nicely with git without any hack.

Cheers

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

No branches or pull requests

2 participants