Sign in to follow this  
Followers 0
Aktonius

FileRead changing " to "

7 posts in this topic

Since i have a code to detect strings in a string without this weird conversions might program might fail if this happens. Ok i can change my code to detect " but i just wonder how many of these conversions of strings can i expect for file read to do?

If you get my point, i feel unpredictable errors might happen if this happens more then i expect

Share this post


Link to post
Share on other sites



If I'm understanding you correctly, you're saying that FileRead is reading quotes from a file and converting them to &quot? I don't believe I've ever seen it do that for me. Are you reading from an HTML document when you do this?


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

From xml

Oh, i should of say that this happens only if it detects double quotes ("") so it will read it as ("") but with single " it wont do any conversion

Edited by Aktonius

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Aktonius,

These symbols are known as "character entities" or sometimes "special entities" in HTML. There are about 30 of them, the most common of which are &quote, &amp, &lt and &gt. You might also run into the formatting symbol &nbsp.

You need to become more familiar with your data, AutoIT is NOT converting anything for you.

Good Luck,

kylomas

Edit: add link - see this link for a list http://www.ask.com/wiki/List_of_XML_and_HTML_character_entity_references

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Kylomas, its not &quote but "

Try it yourself with double "" inside .xml readed with fileread() and you will see it does convert.

edit: It turns out that fileread isnt converting it but IE which i was using to figure out xml content. Hard to say it but i was wrong.

THanks for the link, i guess i will need to make sure i convert every of those entities to converted format to avoid code issues which doesnt look fun at all but i dont see other way.

Edited by Aktonius

Share this post


Link to post
Share on other sites

Aktonius,

Post your script

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

Aktonius,

Run this code to see what AutoIT reads. The .XML suggests that you are working with an object of some sort, perhaps that is where the data is changing.

;
;
;
;   freakin &quot test
Local $str = '""'
FileWrite(@TempDir & "quot.txt",$str)
ConsoleWrite(FileRead(@TempDir & "quot.txt") & @lf)

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


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
Sign in to follow this  
Followers 0