Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1622] UnicodeEncodeError on build

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:56:41.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.5.0
ComponentsiOS
Labelsdefect, ios, iphone, rplist, tiapp, unicode
Reporternetspy
AssigneeReggie Seagraves
Created2011-04-15T02:57:36.000+0000
Updated2011-04-17T01:56:41.000+0000

Description

My iphone app fails to build when I include Unicode characters in the project description field. This is the content of the tiapp.xml:

<description>Deutsche Grammatik einfach, kompakt und übersichtlich</description>

If I performing a full rebuild (empty the build/iphone folder), I get this error in build.log:

Exception detected in script:
Traceback (most recent call last):
  File "/Library/Application Support/Titanium/mobilesdk/osx/1.4.0/iphone/builder.py", line 612, in main
    compiler = Compiler(project_dir,appid,name,deploytype,xcode_build,devicefamily,iphone_version,True)
  File "/Library/Application Support/Titanium/mobilesdk/osx/1.4.0/iphone/compiler.py", line 152, in __init__
    main_file.write(main_template)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 638: ordinal not in range(128)

If I change the description field to ascii only, it works fine.

Titanium Developer 1.2.1
Mobile SDK 1.4
Mac OS X
Xcode 3.2.3
iOS SDK 4.0.2

Comments

  1. netspy 2011-04-15

    There are also UnicodeErrors, if the name field contains unicode characters like German umlauts:

       <name>Sprachführer Deutsch-Englisch</name>
       

    Steps to reproduce

    1. Create new mobile Project
    2. Give project name: „Sprachführer Deutsch-Englisch“
    3. Run project in iPhone emulator

    Result

    Output in Titanium console is:

       [INFO] Compiling JavaScript...one moment
       [INFO] No JavaScript errors detected.
       [INFO] One moment, building ...
       [INFO] Titanium SDK version: 1.4
       [INFO] iPhone Device family: iphone
       [INFO] iPhone SDK version: 4.0
       

    No emulator starts. In build.log there is this error:

       UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 638: ordinal not in range(128)
       
  2. Don Thorp 2011-04-15

    #33 was marked resolved but seems to be occurring in 1.4.X

  3. Jeff Haynie 2011-04-15

    (from [ac324fd512d02b2d766742b8a0704b39514c2983]) [#1622 state:fixed-in-qa] Titanium build system now supports project names and information containing UTF-8 unicode. http://github.com/appcelerator/titanium_mobile/commit/ac324fd512d02b2d766742b8a0704b39514c2983"> http://github.com/appcelerator/titanium_mobile/commit/ac324fd512d02...

  4. Stephen Tramer 2011-04-15

    Will push to 1_4_X when fix confirmed. Note that this issue may persist for android and modules.

  5. Stephen Tramer 2011-04-15

    Doesn't affect Android build process; does appear to affect modules. Seems to be related to how we create xcode projects.

  6. Thomas Huelbert 2011-04-15

    iPod 4th gen (4.1), 3rd gen 4.0.2 with mobile sdk build 1.5.0.62c1cae

JSON Source