Projects > Poasm

Command line parsing modules

(1/3) > >>

Vortex:
Hello,

Attached is a set of modules to parse ANSI and UNICODE command lines.

Siekmanski:
Thanks.

jj2007:
Hi Erol,
What's wrong with this test?


--- Code: ---C:\Masm32\MasmBasic\Members\Erol\ParseCL>TestUnicode.exe Arg1 Введите текст здесь Arg5
Command line parameter 0 = TestUnicode.exe
Command line parameter 1 = Arg1
Command line parameter 2 =
Command line parameter 3 =
Command line parameter 4 =
Command line parameter 5 = Arg5
--- End code ---

Same with wCL$():
--- Code: ---J:\Masm32\MasmBasic\Members\Erol\ParseCL>TestUcMb.exe Arg1 Введите текст здесь Arg5
TestUcMb.exe
Arg1
Введите
текст
здесь
Arg5
--- End code ---

Vortex:
Hi Jochen,

The Windows command line does not provide full unicode support if I am not wrong. Here is my test :

https://ufile.io/gicwi

Edit : The code below did not help either :


--- Code: ---#include <windows.h>
#include <wchar.h>
#include <stdio.h>
#include <locale.h>

int _cdecl main(int argc,char *argv[])
{

int i;

setlocale(LC_ALL, "Russian");

for(i=0 ; i<argc ; ++i)
{
    wprintf(L"Command line parameter %d = %s\n",i+1,argv[i]);
}
}
--- End code ---

https://gist.github.com/pkorotkov/8087262

jj2007:
Hi Erol,

Interesting - it works fine for me. My pre-set codepage is 850, but I can paste Russian (and ä ö ü ç) into the console while codepage is 850. The MasmBasic snippet sets the codepage to 65001 aka UTF-8.

So it seems that Windows pastes and recognises UTF-8, although the codepage is different. It then passes full Unicode to the application: MB takes the Unicode commandline, and displays it as UTF-8 in the console.

Everything clear? No? This is Windows, my friend ::)

Btw which font have you set in the console? Lucida Console? There are only a handful of fonts that work properly, notably LC and Consolas.

P.S.: The C code by pkorotkov doesn't print anything on my console. Really weird: I have put printf statements before and after the wprintf, they display their strings, but there is nothing for wprintf() ::)

Navigation

[0] Message Index

[#] Next page

Go to full version