"周六"的“六”在手机上显示为乱码?
你想反馈一个 Bug
一、* Bug 表现是什么?预期表现是什么?
同样的数据,"周六"的“六”在开发者工具中是正常的,但到了我的手机上显示为乱码
开发者工具上显示(选的iphone6作为模拟器):
手机上显示(华为Mate9):
二、* 如何复现?
后台返回1,2,3,4,5,6,7 的字符,通过前端进行格式化,其中只要“周六”和其他的星期一起出现就显示出乱码了。但单独只有“周六”时正常,将“六”换为“6”显示也正常。
前端格式化代码如下:
function formatRepeat2(repeat2){ if (repeat2 != undefined && repeat2 != '') { if (repeat2.indexOf(',') > -1) { var total = ''; var arrRepeat2 = repeat2.split(','); for (var j = 0; j < arrRepeat2.length; j++) { if (arrRepeat2[j] == '1') { total += ' 周日'; } else if (arrRepeat2[j] == '2') { total += ' 周一'; } else if (arrRepeat2[j] == '3') { total += ' 周二'; } else if (arrRepeat2[j] == '4') { total += ' 周三'; } else if (arrRepeat2[j] == '5') { total += ' 周四'; } else if (arrRepeat2[j] == '6') { total += ' 周五'; } else if (arrRepeat2[j] == '7') { total += ' 周六'; } } return total; } else { if (repeat2 == '1') { repeat2 = ' 周日'; } else if (repeat2 == '2') { repeat2 = ' 周一'; } else if (repeat2 == '3') { repeat2 = ' 周二'; } else if (repeat2 == '4') { repeat2 = ' 周三'; } else if (repeat2 == '5') { repeat2 = ' 周四'; } else if (repeat2 == '6') { repeat2 = ' 周五'; } else if (repeat2 == '7') { repeat2 = ' 周六'; } return repeat2; } } else { return ''; }
that.data.listlog[i].repeat2 = formatRepeat2(repeat2); |
三、* 提供一个最简复现 Demo
见以上
