将特殊字符传递到telnet Unix中 [英] Passing Special Characters into telnet Unix

查看:96
本文介绍了将特殊字符传递到telnet Unix中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下命令通过SMS适配器发送SMS消息:

I use the following command to send SMS messages through SMS Adapters:

telnet localhost 0000 <<-EOF 
helo x
MAIL FROM: Test
RCPT TO: 447999999999
DATA

Test £1234
.
logout
quit
EOF

但是,无论何时我收到的消息都将采用以下格式:

However when ever I get the Message through it will be in the format:

Test ?£1234

附加?在£符号的前面,我尝试研究了包括MIME在内的一些方法,但不确定如何实现.

Appending the ? to the front of the £ symbol, I have tried investigating a few methods including MIME however not quite sure how they can be implemented.

关于如何停止并允许成功通过£的任何想法

Any ideas on how I can stop and allow the successful passthroughs of £

推荐答案

您是否尝试过先对消息进行编码?您可以在UTF-8字符集中使用base64来做到这一点: 例如 转变: msg =£1234" 到: msg ="wqMxMjM0"

Have you tried encoding the message first? You can do this using base64 in UTF-8 charset:- e.g. Convert: msg="£1234" To: msg="wqMxMjM0"

注意:尝试使用在线转换器测试编码/解码- https://www.base64encode.org/

NOTE:Try testing encoding/decoding using the online converter - https://www.base64encode.org/

对文本进行编码后,您可以通过指定MIME类型(如下示例脚本)在telnet中的DATA命令后添加MIME详细信息,从而通过telnet发送消息:-

Once you have encoded your text you can send the message via telnet by adding the MIME details after the DATA command in telnet by specifying MIME types, example script below:-

telnet localhost 0000 <<-EOF 
helo x
MAIL FROM: Test
RCPT TO: 447999999999
DATA
Subject: Test
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: base64

${msg}
.
logout
quit
EOF

希望有帮助.

这篇关于将特殊字符传递到telnet Unix中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆