We have recently released the latest version of VCSSL: Ver. 3.4.52.
You can download it from the following page:
While the previous release mainly focused on compatibility with Java 24, this one introduces several functional improvements.
Let's take a look at the details!
First, let us explain the main feature area that's been improved in this release: integration with external programs.
VCSSL provides a mechanism to run executable files developed in other programming languages (such as .exe, .out, etc.) and communicate with them through standard input/output, allowing for basic inter-process communication.
For more details on this functionality, please refer to the following page in our official documentation:
By leveraging this feature, for example, you can create a simple GUI input screen in VCSSL and connect it to your own C-language program, effectively turning it into a lightweight GUI tool.
Now, let's get into the main improvements. This update includes several enhancements aimed at improving integration with external programs.
One such enhancement deals with character encoding issues, often referred to as "mojibake" (garbled text).
When exchanging text between multiple programs, garbled characters frequently become an issue. This usually occurs when the character encoding used by Program A to output text differs from the encoding expected by Program B when reading it.
For example, until fairly recently, many Japanese-language programs running on Windows defaulted to a character encoding called "CP932."
However, in recent years, there has been a growing shift toward "UTF-8", resulting in a mixed environment where CP932 and UTF-8 coexist, often leading to compatibility headaches.
Similar issues tend to occur in many countries where non-ASCII characters are commonly used.
In this article, we'll use Japanese-language programs as a representative example to illustrate the situation.
By default, when VCSSL runs an external program, it treats the content of its standard input/output as being encoded in UTF-8.
As a result, if the external program (written in C, for example) uses CP932 or another encoding for its I/O, the following workarounds were previously needed -- each with its own drawbacks:
To address this issue, the Process library used to run external programs has been enhanced. We've added the following functions:
By using these functions, you can now easily adjust the character encoding within your script to match the target external program, making it much simpler to avoid garbled text issues.
Here's a example code:
import File;
import Process;
// ----------------------------------------------------------------------
// A VCSSL program that runs example.exe and displays its standard output
// ----------------------------------------------------------------------
// Create a process for example.exe
// ("argA/B/C" are the arguments passed to the program)
string programPath = getFilePath("example.exe");
string processArgs[] = { programPath, "argA", "argB", "argC" };
int processID = newProcess(processArgs);
// Set character encodings for standard input/output/error
setProcessInputEncoding(processID, "CP932"); // or "UTF-8", etc.
setProcessOutputEncoding(processID, "CP932");
setProcessErrorEncoding(processID, "CP932");
// Start running example.exe
startProcess(processID);
// Event handler for receiving standard output
void onProcessOutput(int sourceProcessId, string text) {
print(text); // Display the received text as-is
}
// Event handler for receiving standard error
void onProcessError(int sourceProcessId, string text) {
print(text); // Display the received text as-is
}
code/c_and_vcssl_mojibake_example/ExampleExecution.vcssl
In this example, let's assume that the "example.exe" being executed above is a compiled version of the following C program:
This program outputs the Japanese message:
The VCSSL script then receives this output from example.exe and simply displays it in the console.
Here's what the output looks like:
The message above contains Japanese characters, which are multi-byte and cannot be represented in ASCII. Characters like these will appear garbled if the character encodings don't match properly between programs. Below is the result when we change the encoding specified in setProcessOutputEncoding() to "UTF-8" instead:
As you can see, the output is garbled.
By the way, we've packaged both the compiled "example.exe" and the VCSSL script into a downloadable sample:
Feel free to download it and try switching the encoding used in setProcessOutputEncoding() between "CP932" and "UTF-8" to see how the output becomes garbled or properly displayed depending on the setting.
Note: If you're running this on a system that isn't configured for Japanese, there's a good chance that Japanese characters won't display correctly, simply because the necessary fonts aren't installed.
In that case, you'll need to install a Japanese-capable font, such as the IPA/IPAex fonts and set it to Java Runtime Environment, or modify the C source code to use multibyte characters and encodings that are supported on your system.
Next up is another feature that contributes to improved external program integration:
VCSSL can now detect the type of operating system it's running on.
As shown in the earlier example, we compiled a C program into an executable file named "example.exe", and then ran it from within a VCSSL script.
However, executable files with the ".exe" extension generally only work on Microsoft Windows® systems. (There are some workarounds to run them on other platforms, but they require special environments.)
So, if you want to create a tool using C + VCSSL that works not only on Windows but also on Linux, you'll need to run an alternative executable -- such as one compiled for Linux in the ".out" format.
To support such use cases, we've added two new constants to the "System" library (which is available without needing to import it):
Here's a example snippet that demonstrates the new feature:
When run on Windows 11, it outputs:
And on Ubuntu 24.04 LTS (a popular Linux distribution):
While this doesn't give detailed environment info, it's enough to distinguish between Windows and Linux -- which can be quite helpful when building cross-platform tools.
For more specific system requirements -- like "Windows 10 or 11" or "Ubuntu 24 LTS or later" -- we recommend noting those conditions in your software's documentation.
This update also includes a few additional improvements and fixes. Here's a brief overview:
The Text library now includes the following utility function:
This lets you apply small adjustments to string values. The behavior depends on the value passed in "mode":
In the previous update, we addressed a compatibility issue on Java 24 where paths on network drives would be resolved as UNC-style paths. (For details, see the article below:)
However, after that update, we discovered another related issue that wasn't fully addressed:
In VCSSL, this can happen when using the choose(string directoryPath) function. We've now added a workaround to prevent this behavior.
This one is a bit technical, but we've fixed a parsing bug where certain escape sequences in string literals inside control statement parentheses (like if(...) or while(...)) weren't being interpreted correctly, resulting in strange errors -- even though the code was valid. Sorry about that!
-
That's it for the updates in this release!
We'll continue to post news and updates related to VCSSL here in this section, so stay tuned!