charConvert a char conversion prog for Windows

Anything QL Software or Programming Related.
Post Reply
User avatar
ql_freak
Super Gold Card
Posts: 536
Joined: Sun Jan 18, 2015 1:29 am

charConvert a char conversion prog for Windows

Post by ql_freak »

Hi!

I have written a char conversion Application for windows, which can convert single chars to any substitution.

I have written it for my homepage, to translate all German Umlauts to html escape sequences (e. g. 'ä' to "ä"), but if you edit the *.ini-File, this program can also be used, to convert from QL character set to the ANSI character set of windows. It can convert a lot of different characters in one "run" (there is a table, where you can add substitutions, or add them to the *.ini-file).

It is a program with GUI (a WPF application), the working routine runs as a separate thread (doesn't block the UI) and it can substitute whole directories (unfortunately it currently doesn't recurse into subdirectories).


If anyone wants to test it, there is a preliminary download for QL users (please don't post the link on other websites currently!):

EDIT: Link removed, program is now officially available at:

http://peter-sulzer.bplaced.net/htdocs/ ... harConvert

Screenshots of all my programs can be found on the "Startseite" (http://peter-sulzer.bplaced.net)

There is one self extracting RAR-archive for the executable and a ZIP-archive with the source (published under the GNU GPL V1 or newer). The *.exe and *.ini file in the source archive can be found in subdirectory charConvert/bin/debug. You must also copy the subdirectory "de-DE" below the directory where charConvert.exe is stored if you want to get the German version (default is English).

The program should be pretty self explanatory. The *.ini file must be in the same directory as the *.exe. WARNING: There are file managers for Windows (e. g. Q-Dir) which don't pass the program directory to the program. Then the *.ini file cannot be loaded. The normal Windows File manager does it correctly.
Last edited by ql_freak on Fri Oct 28, 2016 1:34 am, edited 2 times in total.


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
User avatar
ql_freak
Super Gold Card
Posts: 536
Joined: Sun Jan 18, 2015 1:29 am

Re: charConvert a char conversion prog for Windows

Post by ql_freak »

// Edited: Typos

charConvert has been updated to Version 1.0.2

The format for substitutions has changed (old *.ini files won't work anymore!). This is because, you formely can't make substitutions which have leading whitespace (like spaces, tabulators, ...).

Old:

£=£

New:

£=:£

Note the colon after the '='.

Whitspace before the "=:" is allowed but not after the "=:", e. g.:

Code: Select all

£=:   £
will be substituted to:

Code: Select all

   £
which will be most probably not what you want.

But it is still not possible to insert whitespace at the end of the substitution string. The Windows-API for *.ini-file trims the string after the '=' character and after the last non white space character (e. g. " £ = £ " will be read as "£=£"). So unfortunately I have to change the format for substitutions in the *.ini-file again in the next version. Note that there is no problem, if you insert additional substitutions in the substitution table when charConvert is running - but changes you make are currently not stored in the *.ini file.

My solution will most probably be, to ignore the last char of a substitution line:

Currently:

£=:£

In a future version:

£=:£:

(note the colon after the semicolon). Of course you may use any char as the last char, e. g.:

£=:££

will also work.

p.s.: If I'll find the time, I will (or must it be shall?) prepare an *.ini file which will translate alle QDOS-chars beyond 128 to ANSI


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
martyn_hill
QL Wafer Drive
Posts: 1112
Joined: Sat Oct 25, 2014 9:53 am

Re: charConvert a char conversion prog for Windows

Post by martyn_hill »

Hi there

In answer to your grammatical question, 'shall' would be more correct than 'will', due to the use of the conditional-future tense, though we rarely pick-up on such things in English these days :-)


User avatar
ql_freak
Super Gold Card
Posts: 536
Joined: Sun Jan 18, 2015 1:29 am

Re: charConvert a char conversion prog for Windows

Post by ql_freak »

Hi Martyn,
martyn_hill wrote:Hi there

In answer to your grammatical question, 'shall' would be more correct than 'will', due to the use of the conditional-future tense, though we rarely pick-up on such things in English these days :-)
Thank You! AFAICR I have learned in school (5th class or so), when using "I" or "you" you must use shall, else will, but as you wrote (if I have understand you correctly), shall seems nowadays be rarely used.

BTW: I have improved charConvert a lot (Version 1.1.01 from 1.0.2 - I think this is the last public):

NEW LINE TRANSLATIONS ARE NOW SUPPORTED (this was barely missing).

It supports command line arguments:

- Currently: -ini ini_Filename_Path : REMark The space between is mandatory!

The latter means, that you can create different Windows-Links, e. g. one for converting Umlauts to HTML-names, one for converting from QDOS to Windows, one for vice versa, ... which can be started with one click :-)

- there are a few more changes, which I can't remember, and of course bug fixes.

WARNING (new version, perhaps also current): Most propably the prog has a bug: If EOF() occures inside an (note grammatical question below ;-)) HTML-tag in "HTML Mode", it may be, the program will crash (I haven't had the time to test it).

I will release it the next days (this week):

Grammatical Question:

Why is it *an* honour and *a* house? (See the test of this site)


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
User avatar
ql_freak
Super Gold Card
Posts: 536
Joined: Sun Jan 18, 2015 1:29 am

Re: charConvert a char conversion prog for Windows

Post by ql_freak »

Version 1.1.02 is now available on my homepage. I have also prepared two additional *.ini files for converting from QDOS/SMS/QPC2 to Windows and vice versa. Unfortunately not all conversions are included, but at least for German users they should be quite usefull.


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
User avatar
Cristian
QL Wafer Drive
Posts: 1024
Joined: Mon Feb 16, 2015 1:40 pm
Location: Veneto

Re: charConvert a char conversion prog for Windows

Post by Cristian »

ql_freak wrote:
Grammatical Question:
Why is it *an* honour and *a* house?
Because alas it depends on the word pronunciation. The "h" of "house" is strong, but the "h" of "honour" is almost unvocalized.


User avatar
mk79
QL Wafer Drive
Posts: 1349
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: charConvert a char conversion prog for Windows

Post by mk79 »

Nice picture there with Mark Selby :-)

By the way, this is the table employed by QPC

Code: Select all

Q2P_Table       DB      000h, 001h, 002h, 003h, 004h, 005h, 006h, 007h, 008h, 009h, 00Ah, 00Bh, 00Ch, 00Dh, 00Eh, 00Fh
                DB      010h, 011h, 012h, 013h, 014h, 015h, 016h, 017h, 018h, 019h, 01Ah, 01Bh, 01Ch, 01Dh, 01Eh, 01Fh
                DB      020h, 021h, 022h, 023h, 024h, 025h, 026h, 027h, 028h, 029h, 02Ah, 02Bh, 02Ch, 02Dh, 02Eh, 02Fh
                DB      030h, 031h, 032h, 033h, 034h, 035h, 036h, 037h, 038h, 039h, 03Ah, 03Bh, 03Ch, 03Dh, 03Eh, 03Fh
                DB      040h, 041h, 042h, 043h, 044h, 045h, 046h, 047h, 048h, 049h, 04Ah, 04Bh, 04Ch, 04Dh, 04Eh, 04Fh
                DB      050h, 051h, 052h, 053h, 054h, 055h, 056h, 057h, 058h, 059h, 05Ah, '[',  05Ch, ']',  05Eh, 05Fh
                DB      '£',  061h, 062h, 063h, 064h, 065h, 066h, 067h, 068h, 069h, 06Ah, 06Bh, 06Ch, 06Dh, 06Eh, 06Fh
                DB      070h, 071h, 072h, 073h, 074h, 075h, 076h, 077h, 078h, 079h, 07Ah, '{',  '|',  '}',  '~',  '©'
                DB      'ä',  'ã',  'å',  'é',  'ö',  'õ',  'ø',  'ü',  'ç',  'ñ',  'æ',  08Bh, 'á',  'à',  'â',  'ë'
                DB      'è',  'ê',  'ï',  'í',  'ì',  'î',  'ó',  'ò',  'ô',  'ú',  'ù',  'û',  'ß',  '¢',  '¥',  060h
                DB      'Ä',  'Ã',  'Å',  'É',  'Ö',  'Õ',  'Ø',  'Ü',  'Ç',  'Ñ',  'Æ',  0ABh, 0ACh, 0ADh, 0AEh, 0AFh
                DB      'µ',  0B1h, 0B2h, '¡',  '¿',  '€',  '§',  '¤',  '«',  '»',  '°',  '÷',  0BCh, 0BDh, 0BEh, 0BFh
                DB      0C0h, 0C1h, 0C2h, 0C3h, 0C4h, 0C5h, 0C6h, 0C7h, 0C8h, 0C9h, 0CAh, 0CBh, 0CCh, 0CDh, 0CEh, 0CFh
                DB      0D0h, 0D1h, 0D2h, 0D3h, 0D4h, 0D5h, 0D6h, 0D7h, 0D8h, 0D9h, 0DAh, 0DBh, 0DCh, 0DDh, 0DEh, 0DFh
                DB      0E0h, 0E1h, 0E2h, 0E3h, 0E4h, 0E5h, 0E6h, 0E7h, 0E8h, 0E9h, 0EAh, 0EBh, 0ECh, 0EDh, 0EEh, 0EFh
                DB      0F0h, 0F1h, 0F2h, 0F3h, 0F4h, 0F5h, 0F6h, 0F7h, 0F8h, 0F9h, 0FAh, 0FBh, 0FCh, 0FDh, 0FEh, 0FFh
Of course, nowadays the table would be in Unicode, but these were the dark ages of Windows 95 and ANSI.

Cheers, Marcel


User avatar
ql_freak
Super Gold Card
Posts: 536
Joined: Sun Jan 18, 2015 1:29 am

Re: charConvert a char conversion prog for Windows

Post by ql_freak »

@Christian: Thank You

@Marcel: Thank you, I've made a table with QL codes with the help of a small SupberBASIC program and QPC2. Unicode is not needed at the moment as charConvert currently doesn't support Unicode.


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
User avatar
ql_freak
Super Gold Card
Posts: 536
Joined: Sun Jan 18, 2015 1:29 am

Re: charConvert a char conversion prog for Windows

Post by ql_freak »

Archives of charConvert were corrected on my website. There was a typo in winToQdos.ini which unfortunately destroyed SuperBASIC programs. Every ':' was replaced with an õ. It is not necessary to download the archives, you can correct the typo yourself in the file "winToQdos.ini".

Replace the line

:=:õ…

with

õ=:…:

Sorry,

Peter


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
Post Reply