?? cgsmalphabets.java
字號:
// jSMSEngine API.
// An open-source API package for sending and receiving SMS via a GSM device.
// Copyright (C) 2002-2006, Thanasis Delenikas, Athens/GREECE
// Web Site: http://www.jsmsengine.org
//
// jSMSEngine is a package which can be used in order to add SMS processing
// capabilities in an application. jSMSEngine is written in Java. It allows you
// to communicate with a compatible mobile phone or GSM Modem, and
// send / receive SMS messages.
//
// jSMSEngine is distributed under the LGPL license.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
package org.jsmsengine;
/**
This class contains the conversion routines to and from the standard 7bit
GSM alphabet.
<br><br>
Every normal ASCII character must be converted according to the GSM 7bit
default alphabet before dispatching through the GSM device. The opposite
conversion is made when a message is received.
<br><br>
Since some characters in 7bit alphabet are in the position where control
characters exist in the ASCII alphabet, each message is represented in
HEX format as well (field hexText in CMessage class and descendants).
When talking to the GSM device, either for reading messages, or for
sending messages, a special mode is used where each character of the
actual message is represented by two hexadecimal digits.
So there is another conversion step here, in order to get the ASCII
character from each pair of hex digits, and vice verca.
<br><br>
Note: currently, only GSM default 7Bit character set is supported.
In all routines, you may assume the "charSet" parameter as constant.
*/
class CGSMAlphabets
{
protected static final int GSM7BITDEFAULT = 1;
private static final String alphabet = "@?\u00A5\u00E8\u00E9\u00F9\u00EC\u00F2\u00C7\n\u00D8\u00F8\r\u00C5\u00E5腳置速胸尤蜙\u00C6\u00E6\u00DF\u00C9 !\"#\u00A4%&\'()*+,-./0123456789:;<=>?\u00A1ABCDEFGHIJKLMNOPQRSTUVWXYZ\u00C4\u00D6\u00D1\u00DC
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -