Re: replace

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Bob Grommes (bob_at_bobgrommes.com)
Date: 02/02/05


Date: Wed, 2 Feb 2005 10:07:24 -0700

Etu,

Why do you think that your C# program doesn't think the strings are the same
as those in the XML file?

If you are watching this in the debugger then you will see tabs replaced
with \t, quotes replaced with \" but this is just a display convention. The
debugger wants to display all strings like C# constants, and a C# constant
can't contain a quote, so it'll be changed to \" to be syntactially correct.
And any escapable characters will be transformed to escape sequences so that
you can see they are there.

If you are reading the XML files and they don't have the backslashes then C#
won't magically add them back in.

In a similar vein, why do you think that Excel changes tabs to spaces? It
might be doing so, particularly if it doesn't understand \t but realizes
it's some kind of escape sequence and changes it to a space; or, it may know
it's a tab but disallows or transforms them in that context. But if you are
going by what your eye sees to draw this conclusion then you may be drawing
the wrong conclusion. It may well *be* a tab.

--Bob

"Etu" <etu_sho@yahoo.com> wrote in message
news:1107323506.911917.227880@l41g2000cwc.googlegroups.com...

> The problem I have is actually my program first reads some strings
> (with \t, \" and so on) from an XML file and writes these strings to an
> Excel file. After the Excel file is saved, \t becomes a space and \"
> becomes ". Then when my program later reads the strings from the Excel
> file, it doesn't think the strings are the same as those in the XML
> file.



Relevant Pages

  • Re: Look for the multi-language tools
    ... In the company I work with a project which also uses an XML file to hold ... For the loading of the controls in a form I just need one ... For other strings I use ... EXE files, want to use only 1 language file for each language, so the ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Help with Extracting data from XML into Access
    ... <STRINGS> ... Only one route per XML file. ... PATH attributes fromStop and toStop only appear once ...
    (comp.text.xml)
  • Re: Saving form data
    ... What would be the easiest way to 'serialize' the contained data (list of strings) ... Nothing 'tacky' about using a text file since that's what an ini and xml file is anyway. ... If it's app settings data that's required at startup, and/or edited during runtime, and then updated to file at shutdown, usually an INI file is used as an easy alternative, for example, than say the Registry. ... Xml files are a bit more complex to work with via VB's built-in I/O features, but there's APIs that can make it as simple as working with INI files. ...
    (microsoft.public.vb.general.discussion)
  • Re: Unicode from XML - is it possible in VB6?
    ... > display those strings, ANYWHERE, in VB6? ... > odd characters. ... convert the incoming data to unicode and since it already is unicode you'll ... If that's not the problem then what character set is the XML file using? ...
    (microsoft.public.vb.general.discussion)
  • Re: Some notes
    ... tabs are not going to be allowed as indentation to Python code. ... > Keeping them in strings and comments is a non-issue. ... > typing isn't coming to CPython any time soon, probably not even for Py3k". ...
    (comp.lang.python)