<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[My Visual Database — [solved] Request for native UTF8 functions]]></title>
		<link>https://myvisualdatabase.com/forum/viewtopic.php?id=3661</link>
		<atom:link href="https://myvisualdatabase.com/forum/extern.php?action=feed&amp;tid=3661&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in [solved] Request for native UTF8 functions.]]></description>
		<lastBuildDate>Fri, 01 Sep 2017 18:08:27 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: [solved] Request for native UTF8 functions]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=21967#p21967</link>
			<description><![CDATA[<p>Hi,</p><p>Toolbox.pas contains some things I have done to manage :<br />- INI (store window position...),<br />- SQL (escape quote...), <br />- Strings (additional functions to extract text within html/xml node, ...),<br />...<br />and which are very usefull. I include it (or part of it) in all my projects (with another one called drivesoft.pas which contains usefull things found on the forum).</p><p>The wbGetFile.exe download a file : wbGetFile &lt;url of the document to download&gt; &lt;filename&gt;</p><p>The full projet is a rss stream downloader <a href="http://codyssea.com/index.php/2017/08/20/podcastor">http://codyssea.com/index.php/2017/08/20/podcastor</a>.<br />I have made wbGetFile to download the files in the background (without blocking the app) because the content of rss stream can be really big...</p><p>I use a timer to manage the process with some steps : to check if there is something to download, to launch wdGetFile (with OpenFile), to wait from the completion,... and to loop.</p><p>In fact, I use MVD to build the UI of my applications and process the data in background with some exe (made with MVD or other languages because MVD isn&#039;t multithread and I/O are blocking). The first version of wdGetFile was made with .Net (but I made another with purebasic to have less dependencies).</p><p>And finaly I use InstallCreator to build the install.</p><p>Regards,<br />jihem</p>]]></description>
			<author><![CDATA[null@example.com (jihem)]]></author>
			<pubDate>Fri, 01 Sep 2017 18:08:27 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=21967#p21967</guid>
		</item>
		<item>
			<title><![CDATA[Re: [solved] Request for native UTF8 functions]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=21939#p21939</link>
			<description><![CDATA[<p>Bonjour Jean-Marc,</p><br /><p>I&#039;ve been pocking around your script and found two interesting details.</p><br /><p>The first one is that assertion at the beginning :</p><div class="codebox"><pre><code>uses &#039;toolbox.pas&#039;;   </code></pre></div><p>I found the file in the script folder but was wondering if you managed to really use it by including it at the beginning of your script, or if it was just some leftover code you forgot to delete <img src="https://myvisualdatabase.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><br /><p>Second this is that &#039;wbGetFile.exe&#039; application that you distribute with your compiled project.</p><p>Would you mind showing us how you managed to pass the download URL from MVD to that application ?</p><br /><p>Cheers</p><br /><p>Mathias (de Nouvelle Calédonie)</p>]]></description>
			<author><![CDATA[null@example.com (mathmathou)]]></author>
			<pubDate>Thu, 31 Aug 2017 04:35:49 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=21939#p21939</guid>
		</item>
		<item>
			<title><![CDATA[Re: [solved] Request for native UTF8 functions]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=21819#p21819</link>
			<description><![CDATA[<p>Well done. It works.<br />Thanks a lot :-)</p>]]></description>
			<author><![CDATA[null@example.com (jihem)]]></author>
			<pubDate>Tue, 22 Aug 2017 11:16:48 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=21819#p21819</guid>
		</item>
		<item>
			<title><![CDATA[Re: [solved] Request for native UTF8 functions]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=21813#p21813</link>
			<description><![CDATA[<p>Please download latest beta version 3.6b, I&nbsp; made some changes:<br /><a href="https://www.dropbox.com/s/4rfukqr2r1awq32/setup%203.6b.zip?dl=0">https://www.dropbox.com/s/4rfukqr2r1awq … b.zip?dl=0</a></p>]]></description>
			<author><![CDATA[null@example.com (DriveSoft)]]></author>
			<pubDate>Tue, 22 Aug 2017 08:41:06 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=21813#p21813</guid>
		</item>
		<item>
			<title><![CDATA[Re: [solved] Request for native UTF8 functions]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=21803#p21803</link>
			<description><![CDATA[<div class="quotebox"><cite>DriveSoft wrote:</cite><blockquote><p>please make test project to reproduce this problem.</p></blockquote></div><p><a href="http://codyssea.com/downloads/LoadFromFileUTF8.zip">http://codyssea.com/downloads/LoadFromFileUTF8.zip</a></p><p><span class="postimg"><img src="http://codyssea.com/downloads/LoadFromFileUTF8.PNG" alt="http://codyssea.com/downloads/LoadFromFileUTF8.PNG" /></span></p><p>Your sample works well with unicode but not for UTF8 files.</p><p>I think you should add 2 native convert functions: EncodeUTF8 and DecodeUTF8 (like the DecodeUTF8 provided in the podcastor projects) to convert to UTF8 (back and forth). It&#039;s not a bug. It&#039;s a lack of conversion functions. The Web usualy use UTF8 file format (specially ajax calls).</p><p>I found this page for Delphi : <a href="http://docwiki.embarcadero.com/RADStudio/Tokyo/fr/Routines_de_conversion_UTF-8">http://docwiki.embarcadero.com/RADStudi … sion_UTF-8</a><br />Adding DetectUTF8Encoding could be a good idea too.</p><p>I don&#039;t want to be rude. And I am sorry to insist. I got this issue with several languages and it was always solved by using or including these functions (like I did in the previous sample projects). The only problem is that native functions are much faster than the one I wrote in MVD. So please, would you like to include them?</p><p>Be sure, I&#039;m very grateful for your help.<br />Regards,<br />jihem</p>]]></description>
			<author><![CDATA[null@example.com (jihem)]]></author>
			<pubDate>Mon, 21 Aug 2017 15:01:05 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=21803#p21803</guid>
		</item>
		<item>
			<title><![CDATA[Re: [solved] Request for native UTF8 functions]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=21799#p21799</link>
			<description><![CDATA[<div class="quotebox"><cite>jihem wrote:</cite><blockquote><p>Hi,<br />It was my first attempt. Works like a charm for unicode files but does&#039;nt decode UTF8 files properly...</p><p>&quot;Qui veut vraiment rÃ©soudre la crise nord-corÃ©enne ?&quot;<br />instead of<br />&quot;Qui veut vraiment résoudre la crise nord-coréenne ?&quot;</p><p>Regards,<br />jihem</p></blockquote></div><p>please make test project to reproduce this problem.</p>]]></description>
			<author><![CDATA[null@example.com (DriveSoft)]]></author>
			<pubDate>Mon, 21 Aug 2017 12:49:34 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=21799#p21799</guid>
		</item>
		<item>
			<title><![CDATA[Re: [solved] Request for native UTF8 functions]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=21798#p21798</link>
			<description><![CDATA[<p>Hi,<br />It was my first attempt. Works like a charm for unicode files but doesn&#039;t decode UTF8 files properly...</p><p>&quot;Qui veut vraiment rÃ©soudre la crise nord-corÃ©enne ?&quot;<br />instead of<br />&quot;Qui veut vraiment résoudre la crise nord-coréenne ?&quot;</p><p>Regards,<br />jihem</p>]]></description>
			<author><![CDATA[null@example.com (jihem)]]></author>
			<pubDate>Mon, 21 Aug 2017 12:23:30 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=21798#p21798</guid>
		</item>
		<item>
			<title><![CDATA[Re: [solved] Request for native UTF8 functions]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=21790#p21790</link>
			<description><![CDATA[<p>Check it out</p><div class="codebox"><pre><code>function LoadFromFileUTF8 (FileName: string):string;
var
  sl: TStringList;
begin
  sl := TStringList.Create;
  sl.LoadFromFile(FileName);
  result := sl.Text;
  sl.Free;
end;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (DriveSoft)]]></author>
			<pubDate>Mon, 21 Aug 2017 10:42:54 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=21790#p21790</guid>
		</item>
		<item>
			<title><![CDATA[Re: [solved] Request for native UTF8 functions]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=21760#p21760</link>
			<description><![CDATA[<p>Hi Dmitry,<br />You can download the project here :<a href="http://codyssea.com/downloads/podcastor.zip">http://codyssea.com/downloads/podcastor.zip</a> .</p><br /><p>You can click &quot;import&quot; button to test. The program download a rss.xml file (UTF8 encoded). It loads the file and decodes it (from UTF8 to unicode) and stores the result in a MVD string. Then some data are extracted from the xml and stored in the sqlite file (import table). The log table stores the content of the call to log function (so you can see the time each step require).</p><br /><p>I have added the version which uses the my .Net program to convert UTF8 to Unicode :<a href="http://codyssea.com/downloads/podcastor-net.zip">http://codyssea.com/downloads/podcastor-net.zip</a> .</p><br /><p>I&#039;m sad to have to use .Net when everything can be done with MVD but it&#039;s realy too slow without.<br />I hope you could add fast native EncodeToUTF8 and DecodeFromUTF8 functions to MVD.</p><br /><p>One of my whishes is to have the ability to call external dll from MVD so we don&#039;t have to bother you each time we need something. </p><br /><p>Thanks for you help</p><p>Regards,<br />jihem</p>]]></description>
			<author><![CDATA[null@example.com (jihem)]]></author>
			<pubDate>Fri, 18 Aug 2017 15:45:33 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=21760#p21760</guid>
		</item>
		<item>
			<title><![CDATA[Re: [solved] Request for native UTF8 functions]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=21759#p21759</link>
			<description><![CDATA[<p>Please attach your project where I can test it.</p>]]></description>
			<author><![CDATA[null@example.com (DriveSoft)]]></author>
			<pubDate>Fri, 18 Aug 2017 15:19:47 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=21759#p21759</guid>
		</item>
		<item>
			<title><![CDATA[[solved] Request for native UTF8 functions]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=21758#p21758</link>
			<description><![CDATA[<p>Hi,<br />In the topic &quot;[solved] LoadFromFile : Load a UTF8 file content as a string&quot; I made a function to load a file (UTF8) into a string.<br />It works but is very slow : 58 seconds for a file of 400Ko. </p><p>I made the same in C# (and call it from MVD), the job is done in less than 1s (?!).<br /></p><div class="codebox"><pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            var utf8 = File.ReadAllText(&quot;rss.xml&quot;);
            using (StreamWriter sw = new StreamWriter(File.Open(&quot;rss.out&quot;, FileMode.Create), Encoding.Unicode))
            {
                sw.WriteLine(utf8);
            }
        }
    }
}</code></pre></div><p>Dmitry could you, please, include fast native functions to encode/decode UTF8 string (previously loaded with TFileStream) ?</p><p>Regards,<br />jihem</p>]]></description>
			<author><![CDATA[null@example.com (jihem)]]></author>
			<pubDate>Fri, 18 Aug 2017 14:47:16 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=21758#p21758</guid>
		</item>
	</channel>
</rss>
