<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 06/26/2013 02:59 PM, Sven Barth
wrote:<br>
</div>
<blockquote cite="mid:51CAE5A2.5000302@googlemail.com" type="cite"> ...
And using SetCodePage you can force a conversion.
<br>
</blockquote>
<div dir="ltr" style="text-align: left;">
<div class="delphi source-delphi">
<pre class="de1"><span class="kw1">The docs say:
===============================================================================
procedure</span> SetCodePage<span class="br0">(</span><span class="kw1">var</span> S<span class="sy1">:</span> RawByteString<span class="sy1">;</span> CodePage<span class="sy1">:</span> <span class="kw4">Word</span><span class="sy1">;</span> Convert<span class="sy1">:</span> <span class="kw4">Boolean</span><span class="br0">)</span><span class="sy1">;
</span>
</pre>
</div>
</div>
Mit der Routine <strong class="selflink">SetCodePage</strong>
setzen Sie die Codeseite für eine <a
href="http://docwiki.embarcadero.com/Libraries/XE2/de/System.RawByteString"
title="System.RawByteString">RawByteString</a>-Typvariable.<br>
<br>
<pre class="de1"><span class="kw1">===============================================================================
This also is compatible with my suggestion:
If the RawByteString Variable already has a dynamic encoding type other than $FFFF a conversion might or might not be necessary.
This is the same action as assigning a string from a RawByte String.
Thus the function could use an intermediate string variable and set it's dynamic encoding type field to "</span><span class="kw1">CodePage", and <span class="sy1"></span>just call
the same conversion function as compiler magic does when assigning strings.
The conversion function does not use the static encoding type of it's arguments (it even can't know same). So it will do the
appropriate conversion, even if the target in the calling function is a RawByteString. (In fact it will never be called
with a RawByteString target, when the compiler magic creates the call instead of manually done by the </span><span class="kw1">SetCodePage programming)
I see no problem here either.
-Michael
</span></pre>
<br>
<pre class="de1">
<span class="sy1">
</span></pre>
</body>
</html>