BartyCrouch icon indicating copy to clipboard operation
BartyCrouch copied to clipboard

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

Open itolisto opened this issue 5 years ago • 1 comments

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" ?

  • Xcode 10.1
  • Deployment Target: 12.1
  • Swift Language Version: 4.2

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

itolisto avatar Jan 24 '19 07:01 itolisto

@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.

Jeehut avatar Apr 23 '20 22:04 Jeehut