MaxPlankpar Posted March 15, 2016 Posted March 15, 2016 (edited) This script should run when clicked. Tested & should work on Win7 & XP. That said, I banged it out in notepad on another machine for the net upload. This is the chopped down script. Please Help. expandcollapse popup; QuizTest cut down a bit #include<File.au3> #include<array.au3> #include<string.au3> Global $partfile, $line, $filepath, $aRecords $fopend = FileOpenDialog("Select Sections.txt", @ScriptDir, "ANSI Text files (*.txt)") If Not _FileReadToArray($fopend, $partfile Then Exit EndIf _ArrayDelete($partfile, 0) $sectioname = $partfile[1] ; Splash Screen $startreadline = $partfile[2] ; Read line what $stopreadline = $partfile[3] ; to line what $fromansi = $partfile[0] ; curntfile = FileOpen( $fromansi, $FO_UTF8_NOBOM ) ; This removes the í curntfile = FileOpen( $fromansi, $FO_ANSI ) ; This doesnt work $x = startreadline Do $line = FileReadLine($curntfile, $x) & @LF & $line ; string2array for sections-lines If @error = -1 Then ExitLoop $x = $x+1 Until $x = $stopreadline FileClose($curntfile) $aRecords = _StringExplode($line, @LF, 0) For $x = 1 To $aRecords ; goes to whatever count Next $size = Ubound($aRecords) _ArrayReverse($aRecords) ; Upside Down/Rightside Up $aRecords[0] $size ; ut the total UBound size $file = $aRecords[3] $filepath = @ScriptDir & "\NOTANSI" & ".htm" ; QuestionFile FileWrite($filepath, "shat UTF8 " & $file) ShellExecute("NOTANSI.htm", "", @ScriptDir, "") #cs ;each of these ansi files have four lines; did them in pspad ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ questions.txt: --_start_-- ANSIQuestion-0001 nín hǎo | Not <NOBR>í</NOBR> == í Hello (formal) EmptyLine --_end_-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sections.txt: --_start_-- questions.txt ANSI Quiz From This ANSI FILE 0 4 EmptyLine --_end_-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #cs I get à à instead of í í once it goes Unicode on me. this is pretty standard across Windows US keyboarding there are also others that are standardly transcoded badly I recently wrote this, the only thing I've really programmed, & it broke recently with the AutoIt release. This code break makes all my other files a hassle & it will take forever to do the FileWrites over. How do you do them? I don't even know where to start. I need the .htm .txt's in ANSI. Is there a faster way than back&forth-ing them from &#ansi to Unicode. It runs slow enough already. Click&Go ANSI UTF8 $FileOpen QuizTest QuizTest_ANSI_UTF8.txt Edited March 17, 2016 by MaxPlankpar
MaxPlankpar Posted March 15, 2016 Author Posted March 15, 2016 (edited) nÃn hǎo nín hǎo nín hǎo nÃn hǎo | Not í == í BinaryToString for unsupported language. [Solved]https://www.autoitscript.com/forum/topic/181968-binarytostring-for-unsupported-language-solved/ Unicode stringToBinary for unsupported languagehttps://www.autoitscript.com/forum/topic/182255-unicode-stringtobinary-for-unsupported-language/ Edited May 9, 2016 by MaxPlankpar not needed/ superfluffous / Delete
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