Unicode_Lexer_GUI

Started by MrBcx, February 15, 2021, 04:47:45 PM

Previous topic - Next topic

MrBcx

This is the place for all things related to Ian Casey's GUI version of Unicode Lexer

Ian Casey (RIP)

#1
UnicodeLexer.exe is a "C" code  ANSI to Unicode translator.

Download latest UnicodeLexer 3.6 :   https://bcxbasiccoders.com/bcxusers/ian/programs/unicodelexerv3-6.zip  2/21/21

In normal mode you use UnicodeLexer.exe with the $ONEXIT command to change "C" code from ascii to an unicode version by a series of keyword replacements and enclosing text with either _T() [default]  or L() [-l]  or not enclosing text using -t -l parameters that will make it just a search and replace.
TCHARLEXER.txt is the default file of replacement keywords but the user can easily define their own.

a normal call to UnicodeLexer.exe in a BCX program would be:
ONEXIT$ "c:\path\UnicodeLexer.exe  c:\path\Filename.c [optional parameter list]"

It also has a GUI interface that will only start if you don't supply a correct command i.e. valid filename. I put it in there mainly to show a new user the options available or if they just click on the exe. Note that when you pick an option the parameters line changes it then uses the Filename line and the parameters line to call itself. 

For more information go here: https://bcxbasiccoders.com/bcxusers/ian/Ian%27s%20Unicode%20Programming.html

Special Thanks to Garvan O'Keeffe for helping me start this project and Wayne Halsdorf for rewriting most of this version.

Ian Casey (RIP)

I have uploaded the UnicodeLexer v3-6 here:
https://bcxbasiccoders.com/bcxusers/ian/programs/unicodelexerv3-6.zip

Changes include: Increased the maximum line size from 1024 to 4096 due to Set/End Set and Data
Added textbox to GUI interface with $OnExit Command Line for your program after your pick file & parameters

Robert

Quote from: iancasey on February 21, 2021, 08:59:02 AM
I have uploaded the UnicodeLexer v3-6 here:
https://bcxbasiccoders.com/bcxusers/ian/programs/unicodelexerv3-6.zip

Changes include: Increased the maximum line size from 1024 to 4096 due to Set/End Set and Data
Added textbox to GUI interface with $OnExit Command Line for your program after your pick file & parameters

Hi Ian:

Could you zip up a small example of a BCX program containing Unicode characters in strings. For example, an INSTR demo with Chinese characters.

Can you insert the Unicode characters themselves? If so what editor do you use to do that? Or do they have to be the escaped numeric codes of the characters?

It's simple enough with UTF-8. Visual Studio Code, Geany, NotePad++ all are UTF-8 default but I don't understand how the UTF-16LE widechars are entered in the BCX code.

Thank you.

Ian Casey (RIP)

#4
I'll give it a go,   我 会 尝试 的  Pinyin -  Wo hui changshi de

you will need to install the Chinese language pack for Win 10
Settings | Time & Language | Language | Add a language

After installing you should be able to switch languages from the icon in the taskbar.
The icon is a chinese character for English 英 or Chinese 中
in chinese mode type wo and the options will automatically appear in a context menu, pick #1 for 我 = I

Any unicode enabled editor or bcx editbox should be able use it in Pinyin - romanized type text
I do use notepad to edit my .RC files with Chinese - save as UTF16LE. Mostly I am cut and paste from email as I don't speak Chinese。

Google translate is also a great help!!

I have not tried to use INSTR on the Chinese language and I'll need to do some research on that. :-[
I just used BCX_GET_TEXT$ and saved it to file.

You can also search the inet for "Chinese input method" or "Japanese input method".

I hope this helps


Robert

Quote from: iancasey on February 22, 2021, 03:12:33 AM
I'll give it a go,   我 会 尝试 的  Pinyin -  Wo hui changshi de

you will need to install the Chinese language pack for Win 10
Settings | Time & Language | Language | Add a language

After installing you should be able to switch languages from the icon in the taskbar.
The icon is a chinese character for English 英 or Chinese 中
in chinese mode type wo and the options will automatically appear in a context menu, pick #1 for 我 = I

Any unicode enabled editor or bcx editbox should be able use it in Pinyin - english type text
I do use notepad to edit my .RC files with Chinese - save as UTF16LE. Mostly I am cut and paste from email as I don't speak Chinese。

Google translate is also a great help!!

I have not tried to use INSTR on the Chinese language and I'll need to do some research on that. :-[
I just used BCX_GET_TEXT$ and saved it to file.

I hope this helps

Hi Ian:

Many thanks for the info. I've been wondering about that for years and now I understand.

Ian Casey (RIP)

Robert
I also have a UnicodeViewer, in the latest version you can use to pick a Chinese character, right click and send that character to an edit box, from there cut and paste to whatever you want.

UnicodeViewer is at: https://bcxbasiccoders.com/bcxusers/ian/programs/UnicodeViewer.zip

how I save unicode to file: https://bcxbasiccoders.com/bcxusers/ian/programs/Unicode_File_Demo.zip

how I add languages to my programs at: https://bcxbasiccoders.com/bcxusers/ian/Languages.html


Robert

Quote from: iancasey on February 22, 2021, 03:13:14 PM
Robert
I also have a UnicodeViewer, in the latest version you can use to pick a Chinese character, right click and send that character to an edit box, from there cut and paste to whatever you want.
UnicodeViewer is at: https://bcxbasiccoders.com/bcxusers/ian/programs/UnicodeViewer.zip
Hi Ian:
The UnicodeViewer is a very nice piece of work. For many years, for viewing Unicode characters, I have been using Andrew West's BabelMap available at

https://babelstone.co.uk/Software/BabelMap.html

Quote
how I save unicode to file: https://bcxbasiccoders.com/bcxusers/ian/programs/Unicode_File_Demo.zip

Again, a good job! It would be useful for novice coders to have the compilation and linking instructions at the beginning of the code as you have in your UnicodeViewer.
Quote
how I add languages to my programs at: https://bcxbasiccoders.com/bcxusers/ian/Languages.html

This is a very useful tip.

Thanks for posting this.