English 中文(简体)
j Query - How to transformings from text Box to bytes?
原标题:jQuery - How to convert string from textbox to bytes?

i 需要从案文领域改写。 如何做到这一点?

Reason: The text on the textbox will be sent by SMS to the client, and I ve limited the text to 160chars but if i put special chars like @€£‰¶÷‰‰€£@ it will be larger than 256 bytes (that s the size of an sms).

因此,需要从256份改成tes的案文中删除,并将结果改为正常的果园。

<><>>Example:

var charsleft = toChars(256 - toBytes(mystring));

EDIT:
REASON to be on Javascript: i have an line saying something like this "XXX chars left"

最佳回答

参看serverside,你喜欢用一种语言。 Java/ECMA的文字确实是这种行动的一个坏处。 它已经成为一个有<条码>的星号/编码>的星号,因此放弃了赞成和用<条码>连续型号和脚.。 将星号改为UTF8(例如)改为服务器,并在服务器上开展工作。

问题回答

你们利用什么制度从 j子里派SMS? 我怀疑这项服务将通过吉大港山区的请求进行,在这种情况下,这项服务应当为你提供。 在某些情况下,有些特性在通用公平市的特性中没有代表,另一些情况是,特征需要作为 by的 escaped子。

您重新使用的服务文件应当能够向您通报SMS机构的正确格式。

例如:。 http://www.bulksms.com/int/docs/eapi/submission/character_encoding/

全面披露:我为BulkSMS工作





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签