truebit / xUnique

merge Xcode project file is so easy
https://fclef.wordpress.com
Other
1.5k stars 118 forks source link

UnicodeEncodeError #5

Closed shannonchou closed 10 years ago

shannonchou commented 10 years ago

Uniquify and Sort Traceback (most recent call last): File "./scripts2/xUnique.py", line 485, in main(sys_argv) File "./scripts2/xUnique.py", line 466, in main xunique.unique_project() File "./scripts2/xUnique.py", line 154, in unique_project self.replace_uuids_with_file() File "./scripts2/xUnique.py", line 179, in replace_uuids_with_file print(new_line, end='') UnicodeEncodeError: 'ascii' codec can't encode characters in position 38-41: ordinal not in range(128)

truebit commented 10 years ago

I already decoded line string to unicode in line 162:line = line.decode('utf-8'). And I used the Python3 function print (line 22 from __future__ import print_function)which would convert unicode to "utf-8" by default. So it should need not new_line.encode('utf-8') Could you please also attach the line that raised error? and your python version and OS environment?

shannonchou commented 10 years ago

Sorry for replying you late. It works for me after you have fixed #5. Thx!

ZSaberLv0 commented 8 years ago
Uniquify and Sort
Traceback (most recent call last):
  File "xUnique/xUnique.py", line 566, in <module>
    main()
  File "xUnique/xUnique.py", line 546, in main
    xunique.unique_project()
  File "xUnique/xUnique.py", line 188, in unique_project
    self.__unique_project(self.root_hex)
  File "xUnique/xUnique.py", line 365, in __unique_project
    self.__set_to_result(project_hex, target_hex, cur_path_key)
  File "xUnique/xUnique.py", line 141, in __set_to_result
    current_path = '/'.join([str(current_node[i]) for i in current_path_key])
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)

same problem with the latest xUnique, any way to solve this?

truebit commented 8 years ago

could you send me your pbxproj file to my email? You can find it in license file.

2016年6月13日星期一,ZERO notifications@github.com 写道:

Uniquify and Sort Traceback (most recent call last): File "xUnique/xUnique.py", line 566, in main() File "xUnique/xUnique.py", line 546, in main xunique.unique_project() File "xUnique/xUnique.py", line 188, in unique_project self.unique_project(self.root_hex) File "xUnique/xUnique.py", line 365, in unique_project self.set_to_result(project_hex, target_hex, cur_path_key) File "xUnique/xUnique.py", line 141, in set_to_result current_path = '/'.join([str(current_node[i]) for i in current_path_key]) UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)

same problem with the latest xUnique, any way to solve this?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/truebit/xUnique/issues/5#issuecomment-225515169, or mute the thread https://github.com/notifications/unsubscribe/AAuE2o5MYwNLTnklOHeEPM-4XIe8PZjQks5qLREUgaJpZM4CcjZk .

Br,

Sean Wang Blog: fclef.wordpress.com http://fclef.wordpress.com/about

ZSaberLv0 commented 8 years ago

@truebit pbxproj sent to your email with no reply

truebit commented 8 years ago

Sorry, I am busy these days. Will look into it on this weekend

truebit commented 8 years ago

I executed with latest xunique, I got KeyError ('04A0788D18E11A2F0055AB04' not found in result dict ) instead of UnicodeEncodeError:

         projectReferences = (
            {
                ProductGroup = 0429811A18E27E9900B94DFB /* Products */;
                ProjectRef = 04A0788D18E11A2F0055AB04 /* MobileKTV_KTV.xcodeproj */;
            },
            {
                ProductGroup = 047626991B16A25E0053EF29 /* Products */;
                ProjectRef = 047626981B16A25E0053EF29 /* MobileKTV_KTV.xcodeproj */;
            },
         );

I do not know your project structure, but I suspect that the two ProjectRef should be the same?

ZSaberLv0 commented 8 years ago

sorry for that, the xcodeproj file was accidently added to the pbxproj file, remove all of them, and run xUnique again, the UnicodeEncodeError occurrs

truebit commented 8 years ago

ehh.. waste me some time. Could you just send me the correct one??!