EtriX Posted August 29, 2012 Share Posted August 29, 2012 Hello I'm trying to make a small script that copy and pastes text from an excel document to a webform. The problem I am having is that I can either convert to UTF-8 and loose all non-standard characters (I live in Sweden so this is not a option) But when I user ANSI or UTF-16 it seems to displace the uppercase one step. Text I'm trying to copy: Access Username Motivation (containing Å, Ä, Ö) Text I get when trying to copy to notepad: access username motivation (containing å, ä, ö) Text I get when trying to copy to notepad in Citrix: access username motivation 8containing å, ä, ö9 Func __UTF16toUTF8($sUTF16) Return(BinaryToString(StringToBinary($sUTF16, 1))) EndFunc Func __UTF8toUTF16($sUTF8) Return(BinaryToString(StringToBinary($sUTF8), 4)) EndFunc Func printClipboard() $clipboard = StringSplit(__UTF16toUF8(ClipGet()), chr (9)) ;~ MsgBox(0,"", ubound($clipboard)) if ubound($clipboard) = 4 then $behorighet = $clipboard[1] $anvandare = $clipboard[2] $motivering = $clipboard[3] Sleep(100) send(StringLower($behorighet)) Sleep(100) send("{TAB 3}") Sleep(100) send(StringLower($anvandare)) Sleep(100) send("{TAB 3}") Sleep(100) send(StringLower($motivering)) Else msgbox(0,"Felkopierat?","Clipboard: " & ClipGet()) EndIf EndFunc Is there anyway make this script while retaining correct Uppercase, å, ä ,ö and correct characters? Link to comment Share on other sites More sharing options...
jdelaney Posted August 29, 2012 Share Posted August 29, 2012 what about ascii? $astring = StringToASCIIArray ( "Access Username Motivation (containing Å, Ä, Ö)" ) For $i = 1 To UBound ( $astring ) - 1 ConsoleWrite ( chr ($astring[$i]) & @CRLF ) Next IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now