Jump to content

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
    Sleep(100)
WEnd

Func Term1()

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

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

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

EndFunc

Func Term2()

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

Send("^c")
Sleep ("100")
$term2 = ClipGet()

$tabfile2 = FileOpen("tabchar.txt", 128)
$tab2 = FileReadLine($tabfile2)
FileClose($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)

EndFunc

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?

Thanks

Samuel

Edited by leuce
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...