Jump to content

FileRead changing " to "


Recommended Posts

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

Link to comment
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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
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

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...