Problem Description
Emoji keyboard and utf8mb4 encoding is not working in ACS. When user tries to post smiles from IOS and store into ACS server and get back to display in Apps its not showing.
Testing Environment:
Titanium SDK: 3.2.1.GA, 3.2.2.GA
Titanium CLI: 3.2.1
IOS Simulator 7.0.3
Dashboard
Appcelerator Studio, build: 3.2.1.201402061120
Cloud module 3.2.1
Test Code
var Cloud = require('ti.cloud');
Cloud.debug = true;
var win = Ti.UI.createWindow({
backgroundColor : 'white',
layout : 'vertical',
});
var aTableView = Ti.UI.createTableView();
login();
function login() {
Cloud.Users.login({
login : 'username',
password : 'password'
}, function(e) {
if (e.success) {
currentUser = e.users[0];
loggedIn = true;
loaddata();
} else {
Ti.API.info('Error:\\n' + ((e.error && e.message) || JSON.stringify(e)));
loggedIn = false;
currentUser = null;
}
});
}
var input = Ti.UI.createTextField({
height : 35,
top : 10,
left : 40,
width : 240,
hintText : 'This is hint text',
keyboardType : Ti.UI.KEYBOARD_DEFAULT,
returnKeyType : Ti.UI.RETURNKEY_DEFAULT,
borderStyle : Ti.UI.INPUT_BORDERSTYLE_ROUNDED
});
win.add(input);
var post_data = Ti.UI.createButton({
title : 'Create post',
top : 20,
});
win.add(post_data);
post_data.addEventListener('click', function() {
Cloud.Posts.create({
title : input.value,
content : input.value,
}, function(e) {
if (e.success) {
loaddata();
} else {
alert('Error:\n' + ((e.error && e.message) || JSON.stringify(e)));
}
});
});
var load_post = Ti.UI.createButton({
title : 'Load post',
top : 20,
});
load_post.addEventListener('click', function() {
loaddata();
});
win.add(load_post);
win.add(aTableView);
win.open();
function loaddata() {
var data = [];
Cloud.Posts.query({
page : 1,
}, function(e) {
if (e.success) {
Ti.API.info('Success:\n' + 'Count: ' + e.posts.length);
for (var i = 0; i < e.posts.length; i++) {
var post = e.posts[i];
Ti.API.info('post' + JSON.stringify(post));
data.push({
title : post.title,
});
}
aTableView.setData([]);
aTableView.setData(data);
} else {
alert('Error:\n' + ((e.error && e.message) || JSON.stringify(e)));
}
});
}
Step to Reproduce
Create a sample Ti Classic project from AppC Studio
Add cloud module in tiapp.xml file
Activated Appcelerator service in tiapp.xml
Add one user in dashboard.appcelerator.com (username: username and password: password)
Update app.js file with test code
Run on IOS device/simulator
Add data text field and click create post button
Check TableView list (smiles is not working )
Expected Result
Smiles should be display in TableView properly
Actual Result
Smiles will not display
Ref:
http://support.appcelerator.com/tickets/APP-755425/homepage
Thanks
No comments