Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13261] BlackBerry: TextField and Label are not displaying German umlauts

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-04-09T23:06:51.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 08 BB, 2013 Sprint 08, Release 3.2.0
ComponentsBlackBerry
Labelsqe-testadded, sdk-bb
ReporterRussell McMahon
AssigneeJosh Roesslein
Created2013-03-28T23:06:10.000+0000
Updated2014-06-19T12:44:41.000+0000

Description

Test Case

var win = Ti.UI.createWindow({
  layout: 'vertical'
});

var label = Ti.UI.createLabel({
    text : 'Label äöüÄÖÜ'
});
win.add(label);

var textField = Ti.UI.createTextField({
    value : 'TextField äöüÄÖÜ '
});
win.add(textField);

win.open();
Expected: Both the label and text field should properly display the German unicode text. Actual: Garbage characters are drawn instead.

Comments

  1. Josh Roesslein 2013-04-09

    Is there a test case we can reproduce the issue? Is this with typing or using textField.setValue(someText)?
  2. Matthias Kroeger 2013-04-09

    Josh, here is my example from [appc-ti-mobile-blackberry Group](https://groups.google.com/forum/?fromgroups=#!topic/appc-ti-mobile-blackberry/1_w7rivtmt0) I reported some more issues in this group post, so here's my complete comment: {quote} Hi Russ, I wrote a litte test app for testing Label wordwrap and realized even more stuff not working. I tested this on BB10 Simulator, BB10 Dev Alpha B and iOS Simulator. On iOS Simulator everything works as expected, but not on BB10 side. This is what is not working properly: 1. German Umlauts are not displayed correctly in Ti.UI.Label and Ti.UI.TextField. 2. wordwrap don't work (we know that) 3. backgroundColor for Ti.UI.TextField don't work 4. Ti.UI.ScrollView EventListener("click") gets fired if I attempt to scroll the ScrollView 5. In Ti.UI.ScrollView EventListener("click") I can not access "e.source" and "e.source.myRowIndex" 6. for Ti.UI.ScrollView I have to set ContentHeight explicit, because 'auto' don't work {quote}
       var win = Ti.UI.createWindow({
           backgroundColor : 'darkgray'
       });
       
       Ti.API.info('Ti.Platform.displayCaps.density: ' + Ti.Platform.displayCaps.density);
       Ti.API.info('Ti.Platform.displayCaps.dpi: ' + Ti.Platform.displayCaps.dpi);
       Ti.API.info('Ti.Platform.displayCaps.platformHeight: ' + Ti.Platform.displayCaps.platformHeight);
       Ti.API.info('Ti.Platform.displayCaps.platformWidth: ' + Ti.Platform.displayCaps.platformWidth);
       
       /* iPhone Simulator
        [INFO] Ti.Platform.displayCaps.density: medium
        [INFO] Ti.Platform.displayCaps.dpi: 160
        [INFO] Ti.Platform.displayCaps.platformHeight: 480
        [INFO] Ti.Platform.displayCaps.platformWidth: 320
        */
       /* BlackBerry Simulator BB10_0_10.261
        [INFO] Ti.Platform.displayCaps.density: high
        [INFO] Ti.Platform.displayCaps.dpi: 326.0563532730535
        [INFO] Ti.Platform.displayCaps.platformHeight: 1280 (392dp)
        [INFO] Ti.Platform.displayCaps.platformWidth: 768   (235)
        */
       var myFontSize; 
       if (Ti.Platform.osname === 'blackberry') {
           myFontSize = 8;
       } else {
           // Android, iOS
           myFontSize = 14;
       }
               
       
       function createRow(i) {
           var row = Ti.UI.createView({
               myRowIndex : i,
               layout : 'vertical',
               backgroundColor : 'darkgray',
               borderColor : '#bbb',
               // borderWidth: 1, ==> don't work for BlackBerry
               width : '100%',
               height : 65,
               left : 0
           });
       
           // invisible Label to keep a url
           var urlLabel = Ti.UI.createLabel({
               touchEnabled : false,
               backgroundColor : 'darkgray',
               color : 'darkgray',
               text : 'http://www.google.de',
               wordWrap : false,
               font : {
                   fontSize : myFontSize,
                   fontFamily : 'Helvetica Neue'
               },
               left : 5,
               right : 5,
               width : Titanium.UI.FILL,
               height : 5
           });
           
           var headerLabel = Ti.UI.createLabel({
               touchEnabled : false,
               backgroundColor : 'darkgray',
               color : 'white',
               text : 'Header Label äöüÄÖÜ ' + (i + 1) + ' with a long text to see if it can span over more than one row or not',
               textAlign : Ti.UI.TEXT_ALIGNMENT_LEFT,
               wordWrap : true,
               font : {
                   fontSize : myFontSize,
                   fontWeight : 'bold',
                   fontFamily : 'Helvetica Neue'
               },
               left : 5,
               right : 5,
               width : Titanium.UI.FILL,
               height : 37
           });
       
       
           var textField = Ti.UI.createTextField({
               touchEnabled : false,
               backgroundColor : 'darkgray',
               color : 'white',
               value : 'Text Label äöüÄÖÜ ' + (i + 1),
               textAlign : Ti.UI.TEXT_ALIGNMENT_LEFT,
               font : {
                   fontSize : myFontSize,
                   fontFamily : 'Helvetica Neue'
               },
               left : 5,
               right : 5,
               width : Titanium.UI.FILL,
               height : 22 
           });
       
           var line = Ti.UI.createLabel({
               touchEnabled : false,
               backgroundColor : 'lightgray',
               width : '100%',
               height : 0.5
           });
       
           row.add(urlLabel);
           row.add(headerLabel);
           row.add(textField);
           row.add(line);
       
           return row;
       }
       
       var scrollView = Ti.UI.createScrollView({
           contentHeight : 65 * 20, //'auto',
           layout : 'vertical',
           horizontalBounce : false
       });
       
       var i = 0;
       for (i; i < 20; i++) {
           var row = createRow(i);
           scrollView.add(row);
       }
       
       scrollView.addEventListener("click", function(e) {
           alert('source=' + JSON.stringify(e.source));
           alert('source.myRowIndex=' + e.source.myRowIndex);
       });
       
       win.add(scrollView);
       
       win.open();
       
    Hope that helps, Matthias
  3. Josh Roesslein 2013-04-09

    Thanks Matthias! Just found that myself a few minutes ago. Added a simplified test case for this bug above. The fix was pretty quick, so it should be pushed in a few minutes and available via CI and the next release.
  4. Matthias Kroeger 2013-04-09

    Perfect! Thanks Josh.
  5. Lokesh Choudhary 2013-04-09

    Verified the fix & the german emlauts are displays properly. Environment: Ti Studio : 3.1.0.201304051530 Ti BB SDK : 3.2.0.v20130409153013 Mac OSX : 10.8.2 win 7 Win 8 BB simulator : 10.0.10.261 Z10 device running 10.0.10.88
  6. Lokesh Choudhary 2013-04-09

    Reopening to correct the ti sdk version.
  7. Lokesh Choudhary 2013-04-09

    Closing after editing the Ti sdk version which was put wrong my me.

JSON Source