Jump to content
Sign in to follow this  

Unicode in Inputbox display problem

Recommended Posts


G'day everyone

I have a simple glossary creation script that I'm in the process of converting to Unicode. I can get the script to create a nice UTF-8 glossary, but I can't get the default text in the InputBox to display correctly if it is Unicode. It just displays little squares. Any idea how to fix it?

Basically the script works like this:

1. Highlight a source term, and press Ctrl+Alt+T

2. Highlight a target term, and press Ctrl+Alt+Y

3. An InputBox pops up with the source term, a tab, the target term, and another tab in it.

4. The user edits the entry, and accepts by pressing OK

5. The entry is added to a tab delimited glossary

Here is the current script:

; To set it up, change the GLOSSARYFILEANDPATH with the path to your
; glossary folder and a glossary file.  For example:
; $glossary = FileOpen("C:\My Documents\Glossaries\glossary.txt", 1)

; You must have a file named tabchar.txt in the same folder as the
; script.  The file tabchar.txt should contain only a tab character.

; Version 2, which adds a second tab for a three column glossary

HotKeySet("!^t", "Term1")
HotKeySet("!^y", "Term2")

MsgBox (0, "OmTaddterm", "OmTaddterm version 2, by Samuel Murray. Please refer to the readme.txt file for instructions.", "")

While 1

Func Term1()

$tempfilea = FileOpen("termtemp.txt", 130)

Sleep ("100")
$term1 = ClipGet()
FileWrite ($tempfilea, $term1)

$tabfile1 = FileOpen("tabchar.txt", 128)
$tab1 = FileReadLine($tabfile1)
FileWrite ($tempfilea, $tab1)


Func Term2()

$tempfileb = FileOpen("termtemp.txt", 129)

Sleep ("100")
$term2 = ClipGet()

$tabfile2 = FileOpen("tabchar.txt", 128)
$tab2 = FileReadLine($tabfile2)
FileWrite ($tempfileb, $term2)
FileWrite ($tempfileb, $tab2)
FileClose ($tempfileb)

$tempfilec = FileOpen("termtemp.txt", 128)

$termpair = FileReadLine($tempfilec)

$termpai2 = InputBox("Check new glossary entry", "This is the new term pair to be added to the glossary. Make changes, if any, and press OK to add.", $termpair)

FileClose ($tempfilec)

$glossary = FileOpen("GLOSSARYFILEANDPATH", 129)
FileWriteLine ($glossary, $termpai2)
FileClose ($glossary)


And the non-Unicode version is here:

http://www.leuce.com/tempfile/omtautoit (it's called omtaddterm).

So, is there a way to make the InputBox display the characters correctly?



Edited by leuce

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.