Jump to content

How to write characters in other languages? (russian,greek,etc)

Recommended Posts

I'm trying to make a script that will need a function that writes a string in another language. The problem is that I looked at the ascii code in the help file and there aren't the special characters of languages like russian or greek. For instance 'programming' in russian is 'программирование'

How can I write the 'п' for instance? In scite when I try to do it it writes '????????????????' if I copy paste it . The same goes with 'programming' in greek which is 'προγραμματισμού' .

I guess there are two possible solutions:

1) Using google translate to translate the words and get them back in a string variable

2) Storing the string in russian or greek in a txt file (What should I use? Unicode or Unicode big endian or UTF-8?) and then pulling it to a string variable

In both cases I would need some kind of 'encoding' to be able to 'write' them...

I'm afraid my post is likely to not making any sense, but I'm confused about what I'm missing here. The problem that underlies my confusion I think it is that I don't know whether it is a problem of the operating system or a problem of autoit.

To summarise my problem, how can I use string variables with characters from other alphabets in autoit? Is there any udf/function/snippet to do that? Or is there a simpler way? In that case I would appreciate any guidance.

Thanks for your help!

Edited by Mithrandir
Link to post
Share on other sites

You need to change the encoding for the script to "UTF-8 with BOM". In the SciTE "File" menu, go to "Encoding" and select "UTF-8 with BOM".

You will get this warning when you try to run or compile a Unicode script. Do not try to use the Obfuscator on a Unicode script because it will fail to compile.

! ***************************************************************************************************
! * Input file is UTF8 encoded, Au3Check/Obfuscator do not support UNICODE and will be skipped.*
! ***************************************************************************************************
Thank you a lot! I tested Fileread, Filewrite with Fileopen in write mode+utf-8 with bom (which is 129) , regexp and all function well!

Now I'm researching the encoding of characters to send them with _WinHttp UDF, It seems that to read for instance the response data

from WinHttpSimpleRequest($hConnect, $sType, $sPath [, $sReferrer = Default [, $sData = Default [, $sHeader = Default [, $fGetHeaders = Default [, $iMode = Default ]]]]]) The $iMode should be set to 1 to read the data as utf-8. One thing that I don't get, why the default is ANSI? Because with utf-8 we can read characters from more alphabets than with ANSI. Is it faster to read in ANSI than in utf-8?

As far as I know, there shouldn't be any problem with sending data that have characters in russian or greek in an http request because the only things that are encoded are the special characters like '&' which have an ascii code. If this is not true, I would like to know if I have to do something more.

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...