FlineDev / BartyCrouch

Localization/I18n: Incrementally update/translate your Strings files from .swift, .h, .m(m), .storyboard or .xib files.
MIT License
1.36k stars 121 forks source link

Localizable couldn't be opened because the text encoding of its contents can't be determined #113

Open itolisto opened 5 years ago

itolisto commented 5 years ago

Hello,

Why am i getting "Error! The file Localizable.strings couldn't be opened because the text encoding of its contents can't be determined" ?

I use

if which bartycrouch > /dev/null; then
# Incrementally update all Storyboards/XIBs strings files
bartycrouch interfaces -p "$PROJECT_DIR/$PROJECT_NAME"

# Add new keys to Localizable.strings files from NSLocalizedString in code
# -k: use un-localized value as default value for translation.
# -s: sort by keys
# -a: only add keys
# -c: override comments
bartycrouch code -p "$PROJECT_DIR/$PROJECT_NAME" -l "$PROJECT_DIR" -a -s -k -c

else
echo "warning: BartyCrouch not installed, download it from https://github.com/Flinesoft/BartyCrouch"
fi

Error

ℹ️ BartyCrouch: Successfully updated strings file(s) of Storyboard or XIB file.
ℹ️ BartyCrouch: Successfully updated strings file(s) of Storyboard or XIB file.
ℹ️ BartyCrouch: Successfully updated strings file(s) of Storyboard or XIB file.
ℹ️ BartyCrouch: Successfully updated strings file(s) of Storyboard or XIB file.
❌ Error! The file “Localizable.strings” couldn’t be opened because the text encoding of its contents can’t be determined.
❌ Error! Could not read strings file at path '/Users/edgargomez/Desktop/Projects/ios/DerivedData/Dingo/Build/Products/Debug-iphonesimulator/Dingo.app/en.lproj/Localizable.strings'

This is how my file "Text Settings" look like:

image

Jeehut commented 4 years ago

@itolisto I know, I'm getting back to this very late. But if you're still interested in a solution to this, please provide me a Demo project where I can reproduce this, otherwise I fear I can't fix it.

Will close this since it's very old and not reported by anyone else if no answer soon.