Jump to content

need help working with Unicode characters in clipboard text


Recommended Posts

I'm trying to automate a process, and I've run into a snag.. I have a 3rd party application which generates some text that I need to work with in autoit

unfortunately its giving me trouble, because it uses unicode characters in the text . specifically these four which represet card suits:

♠♦♥♣

this program outputs some text to the clipboard, I need autoit to dump that clipboard data to a text file.

Right now using ClipGet() and FileWrite it strips all the unicode out and sends only ?'s. I open the file with mode 16 Unicode, but still strips them. I've tried modes 32, 128.. same result

$results = ClipGet()
FileOpen("z:\test.txt",16)
FileWrite ( "z:\test.txt", $results )
FileClose("z:\test.txt")

I've tried a seperate tool, swiss file knife CLI text program which has a clipboard-to-text function but it has the same issue, it outputs ??'s

How can I output this clipboard data to a text file easily ?

The problem seems to be with FileWrite and not ClipGet(), because if I have autoit show me a MsgBox with the ClipGet() data it shows the unicode card suits just fine

Edited by Valhalla1
Link to comment
Share on other sites

an ugly hack is to have autoit open Notepad.exe, paste the clipboard data, save the file and select Unicode in the dropdown on the save dialog gui, then close notepad.

this however is slow, ugly hack, and unstable. I need this process to be smoothly integrated in my autoit so accomplished within autoit or a simple CLI tool

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...