Jump to content

Arabic text?


Recommended Posts

Hello all,

I am writing an app that needs to be able to save and open texts that are in Arabic as well as English... Do I just need to save as unicode?

I tried this

fileopen ($filename, 128))

filewrite ($filename,$encryptedtext)

Anywho, any ideas?

;)

The current version of AutoIt is Unicode capable, and does not need the mode option for read. You should only have to select a mode when opening the file for write. If the read and write are to the same file then:

1. Just FileRead() without opening first, then FileOpen() with appropriate mode for FileWrite().

2. Or FileOpen()/FileRead()/FileClose() without a specified mode, then FileOpen() with appropriate mode for FileWrite().

Another option, since you imply encryption, is to just use binary modes and ignore the text encoding.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Thank you for your help :) I am making this for Christians in the middle east... I had to present this to a guy I work with, and realized while I was showing it to him that I forgot to check if Arabic would work... I hadn't compiled it in the beta for some reason that I can't remember...

http://www.ArabsforChrist.org - Missions to the Middle East
Link to comment
Share on other sites

I am still lost...

I just tried this,

$encryptedtext = _StringEncrypt(1,(Guictrlread ( $textwindow)),$inputpass,$inputlevel) 

                fileopen ($filename, 130)
                filewrite ($filename,$encryptedtext)

                FileClose ($filename)
                WinSetTitle("AFC Encrypto","", "AFC Encrypto " & $filename)
                $saved = "yes"

All arabic characters are returned as question marks still... It doesn't shut the program off, as it did when I first tried putting arabic in. :)

I am working on this via wine, i don't think that makes a difference though... ;)

Screenshot plus files found at:http://christianmissiontrips.org/forum/viewtopic.php?f=8&p=1530#p1530

Thanks again

encrypter.au3

http://www.ArabsforChrist.org - Missions to the Middle East
Link to comment
Share on other sites

I don't have the Arabic language pack loaded, so I can't test your exact situation. But try this:

$encryptedtext = RC4($inputpass, GUICtrlRead($textwindow))
$hFile = FileOpen($filename, 16 + 2)
FileWrite($hFile, $encryptedtext)
FileClose($hFile)

$readtext = FileRead($filename)
$decryptedtext = RC4($inputpass, $readtext)
MsgBox(64, "Test", $readtext)

Note that your use of FileOpen was wrong, because you did not save and use the file handle after opening it.

In addition, this uses binary mode for the file open, vice UTF-8.

This uses SkinnyWhiteGuy's AutoIt translation of a straight binary RC4() encryption. There are other encryption schemes available if you search a bit.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...