Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Wolfgang Riedmann" Newsgroups: comp.lang.clipper.visual-objects Subject: Re: Why does ANSI character convert after a function returns is? Date: Thu, 18 Dec 2014 07:42:11 +0100 Lines: 53 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: individual.net ewYm6PYW+nT2dtjgjGVnlwcSViOhfgIyTONxz3JTDVoxUTh7c= Cancel-Lock: sha1:LpSJp4XF5HR7aaaAtl5+4YbcmHE= User-Agent: XanaNews/1.18.1.6 Xref: csiph.com comp.lang.clipper.visual-objects:7628 Hi Dick, > This is very weird....I open a HTML source document and replace a > couple of phrases (which I use as fields) in it. As a test, I store > the output on disk: it depends from what functions do you use to read/write the file. Some of the VO functions do ansi/oem caracter conversion. This is a comment from the VO help: "FWrite() and FWrite3 are assumed to handle raw binary data and are not dependent upon the status of SetAnsi(). FWriteText() and FWrite4(), on the other hand, are dependent upon SetAnsi()." Wolfgang > > FUNCTION LoadModelDoc (....) as string > cSource:=StrTran(cSource,cSearch,cReplace,1) > WriteString2File("c:\temp\test1.htm",cSource,FALSE) > RETURN cSource > > Open test1.htm in a webbrowser I correctly see the German > sz-character: > > Straße 3 > > The calling code is like this: > > cSource:=LoadModelDoc(....) > WriteString2File("c:\temp\test2.htm",cSource,FALSE) > > However, without any changes, simply returning the value, the sz > character changes to a character looking as a question mark in a > diamond when I open test2.htm in a browser: > > Stra"-??e 3 > > So no dbf storage, just returning a string cSource which is still > correct in the function called just before returning it's value > ...and it is changed directly after! > > How could this happen be and how can I prevent it? > > Dick --