Jump to content

Design Question: Encoding special characters in INI section and key names


Recommended Posts

I have a design question regarding the encoding of special characters in INI file section and key names (for example, if you have an EOL or other special character in your section/key name). This relates to an improvement being made to the OpenG Variant Configuration File IO VIs that allow variant data to be written to and read from INI files. I have posted the design question, here. Your feedback and participation in this process is appreciated, since many people rely on these VIs.

Thank you,

Link to comment
You should probably avoid the first 32 characters (00 through 31 decimal). The ini files are pure ASCII files, and the first 32 characters are "unprintable". The biggest problem would be character 26, aka ctrl+z, aka the end-of-file indicator. Writing it into the file as part of a key value would result in the end of file being assumed whether it was really the end of the file or not. That would mean using your escape sequence for \00 through \1F. It would encompass the \r and the \n characters.

Yes, you are right about \00 through \1F, Actually, the code I wrote already did \00 through \1F, but somehow the VI documentation and my posting/question stated \00 through \0F. But, my code also redundantly included \r (\0D) and \n (\0A). I've fixed that, now.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.