如何解决javascript长度的unicode问题?

时间:2016-03-03 18:23:39

标签: javascript java angularjs unicode

我有字符计数器的角度工具提示,但是当我们将数据发布到后端时,用户复制粘贴文本并添加一些与java和orcale长度不对齐的ascii字符时,我遇到了一些问题,让我们说如果用户在文本中有@,它会将长度计为1,但后端将计为4,因为oracle和java使用字节的方式。 所以我想解决两个问题。

1-当我粘贴文本时,字符计数器应该计算与java相同的unicode?

2-它不应该从文本中删除字符吗?

main.html中

<textarea rows="2" class="form-control"
    ng-model="processDTO.processStatementText"
    name="processStatement" id="processStatement"
    placeholder="Process Statement" maxlength="4000" required
    data-tooltip-html-unsafe="<div>{{4000 - processDTO.processStatementText.length}} characters left</div>"
    tooltip-trigger="{{{true: 'focus', false: 'never'}[processDTO.processStatementText.length >= 0 || processDTO.processStatementText.length == null ]}}"
    tooltip-placement="top" tooltip-class="bluefill">
</textarea>

main.txt

2.  Upload Template Header – Risk Causal and Impact comments are color coded as mandatory but they are optional. Similary the Originating Source System Process/Risk/control ID
3.  In the upload template, for any of the multi value fields, I use an invalid delimiter ‘:’, Eg: 13:7 , for some reason this changes the cell format to time format and thereafter I am not able to give any single values, its always converted to time format. Not sure if this is a training issue, but want to put it on the table to see if it requires any fix at all
4.  In Upload, for the grid field length validations, the filter doesn’t works on Row Number and Max Allowed columns. ~!@#$%^&amp;*()_+|}{:&quot;?&gt;&lt;,./&#39;;[]\=-0987654321`
5.  ERH All levels added in the View End to End ERH screen – Sort and Filter doesn’t works, After clicking on this field, none of the other filter/sort works on the page. Also the sort indicator(black triangle) is not visible, I believe the column width needs to be adjusted.
6.  The Risk/Control reference id is seen on the Process Search grids, but when I search by Risk/Control, I don’t see the corresponding control/risk grid having the ref id column however tool tip has it
7.  The label change “Originating Source System Process/Risk/Control ID”"

0 个答案:

没有答案
相关问题