iphone - Parse .strings file with Python -


I am trying to write a short python script to parse the .strings file in my iPhone application project and it Determine which key is not in use, I'm also taking some results and filtering some strings to filter. This is where my problems begin :) If I try something like string for file_line in string_film

 : if 'search_keyword' is in file_line: ...  

Search keywords will not match very often, even though I print every file line in it because I think the text is reading properly and my search keywords appear .

The problem is. String files are in some binary format Do anyone know the proper way to parse these files?

Use the right encoding to open. String -file and your According to the encoding of your file can be UTF-16. Import codecs for line in .- .csen.open (u'your_file.strings'):

  # - * - coding: utf-8- *, encoding = 'UTF-16'): If the 'keyword' is in the queue: #process line  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -