[erlang-questions] Euro Symbol (€) conversion from HTTP API to SMPP through mochiweb

Bob Ippolito bob@REDACTED
Fri Nov 7 17:34:30 CET 2014


I don't know anything about SMPP encoding, so I don't have that answer for
you, but I've told you everything you need to know related to mochiweb and
UTF8. Now that you have a list of unicode codepoints I'm sure you can find
a way to translate that to SMPP bytes, even if you have to implement the
encoding table yourself.

On Fri, Nov 7, 2014 at 1:36 AM, Sanath Prasanna <ahe.sanath@REDACTED>
wrote:

> Dear Rob,
> Tx for example. I got binary values (E2,82,AC) in my HTTP server module
> when submit above using URL. (when used InputParas = Req:parse_qs() )
> I want to replace E2,82,AC  from 1B,65 in http server module, before
> sending to SMPP module. (which is responsible to deliver SMS)
> Br,
> Sanath Robert
>
>
> On Fri, Nov 7, 2014 at 2:33 PM, Bob Ippolito <bob@REDACTED> wrote:
>
>> 1>
>> unicode:characters_to_list(iolist_to_binary(mochiweb_util:unquote("%E2%82%AC"))).
>> [8364]
>>
>> On Fri, Nov 7, 2014 at 12:21 AM, Sanath Prasanna <ahe.sanath@REDACTED>
>> wrote:
>>
>>> Hi Bob,
>>> Tx for quick reply. I go through & unable to find direct function to do
>>> that.If you never mind, can you elaborate with example.?
>>> Br,
>>> Sanath Roberto
>>>
>>> On Fri, Nov 7, 2014 at 10:52 AM, Bob Ippolito <bob@REDACTED> wrote:
>>>
>>>> Use the unicode module to decode the UTF8 if you need a string of
>>>> Unicode code points. If you need to decode a URL encoded string then you
>>>> can use mochiweb_util for that.
>>>>
>>>>
>>>> On Thursday, November 6, 2014, Sanath Prasanna <ahe.sanath@REDACTED>
>>>> wrote:
>>>>
>>>>> Hi,
>>>>> I used mochiweb web server to handle http request. I submit messages
>>>>> with euro - € as "%E2%82%AC" thorugh HTTP API. I need to forward this to
>>>>> SMPP connction. Before that I want to convert that to 1B65. Otherwise €
>>>>> character is not display in mobile.
>>>>> How to do that ? Appreciate if some can help to do that.
>>>>> Br,
>>>>> Sanath Roberto
>>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20141107/250bf066/attachment.htm>


More information about the erlang-questions mailing list