Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change data coding to support Arabic character set #5

Merged
merged 2 commits into from
Jun 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions Test/SmppTestClient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,27 @@

Console.Write("\n#>");

string? command = Console.ReadLine();
Console.WriteLine("Select language for testing: ");
Console.WriteLine("1. English");
Console.WriteLine("2. Arabic");

string choice = Console.ReadLine();

Check warning on line 56 in Test/SmppTestClient/Program.cs

View workflow job for this annotation

GitHub Actions / create_nuget

Converting null literal or possible null value to non-nullable type.

Check warning on line 56 in Test/SmppTestClient/Program.cs

View workflow job for this annotation

GitHub Actions / create_nuget

Converting null literal or possible null value to non-nullable type.

Check warning on line 56 in Test/SmppTestClient/Program.cs

View workflow job for this annotation

GitHub Actions / build

Converting null literal or possible null value to non-nullable type.

Check warning on line 56 in Test/SmppTestClient/Program.cs

View workflow job for this annotation

GitHub Actions / build

Converting null literal or possible null value to non-nullable type.
string? command;

switch (choice)
{
case "1":
command = "send 12223334444 Hello";
break;
case "2":
command = "send 12223334444 سلام علیکم";
break;
default:
Console.WriteLine("Invalid choice, defaulting to English.");
command = "send 12223334444 Hello";
break;
}

if (command == null || command.Length == 0)
continue;

Expand Down Expand Up @@ -99,11 +119,13 @@

// This is set in the Submit PDU to the SMSC
// If you are responding to a received message, make this the same as the received message
DataCodings submitDataCoding = DataCodings.Default;
// Adjusted to ucs2 for supporting Arabic character.
DataCodings submitDataCoding = DataCodings.UCS2;

// Use this to encode the message
// We need to know the actual encoding.
DataCodings encodeDataCoding = DataCodings.ASCII;
// Adjusted to ucs2 for supporting Arabic character.
DataCodings encodeDataCoding = DataCodings.UCS2;

// There is a default encoding set for each connection. This is used if the encodeDataCoding is Default

Expand Down
Loading