Reading and Writing Unicode Files using C/ALhttp://blogs.msdn.com/b/nav/archive/2012/12/05/unicode-and-microsoft-dynamics-nav-2013.aspxHello,
We have had some partner suggestion for adding Unicode capabilities to the existing Microsoft Dynamics NAV File functions. What we recommend is to use .NET Interop to achieve this functionality.
For example, you can use an instance of theen-USTelligent Evolution Platform Developer Build (Build: 5.6.50428.7875)re: Reading and Writing Unicode Files using C/ALhttp://blogs.msdn.com/b/nav/archive/2012/12/05/unicode-and-microsoft-dynamics-nav-2013.aspx#10563251Wed, 08 Oct 2014 12:07:05 GMT91d46819-8472-40ad-a661-2c78acb4018c:10563251User2<p>When writing large files the memory footprint of the service tier is very big (hundreds of megabytes for writing a 50 mb file).</p>
<p>Something I wouldn&#39;t expect when working with file streams.</p>
<p>Same code in a dotnet language has very low memory footprint (less than 5mb).</p>
<p>The same is with other file-stream related stuff (reading and writing, like XmlWriter and XmlReader).</p>
<p>Seems like a bug with stream handling in nav runtime to me.</p>
<p>Can you please check this?</p>
<p>thanks &amp; best regards</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10563251" width="1" height="1">re: Reading and Writing Unicode Files using C/ALhttp://blogs.msdn.com/b/nav/archive/2012/12/05/unicode-and-microsoft-dynamics-nav-2013.aspx#10557174Thu, 11 Sep 2014 09:52:50 GMT91d46819-8472-40ad-a661-2c78acb4018c:10557174User<p>I try this solution for 2009R2 but it gives the error &quot;Unknown type &#39;&#39;.&quot; when I try to compile.</p>
<p>I already change the reserved names like outStream.</p>
<p>Any ideia?</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10557174" width="1" height="1">re: Reading and Writing Unicode Files using C/ALhttp://blogs.msdn.com/b/nav/archive/2012/12/05/unicode-and-microsoft-dynamics-nav-2013.aspx#10492985Mon, 27 Jan 2014 11:34:24 GMT91d46819-8472-40ad-a661-2c78acb4018c:10492985Allan<p>@Sebastian: So what to do?</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10492985" width="1" height="1">re: Reading and Writing Unicode Files using C/ALhttp://blogs.msdn.com/b/nav/archive/2012/12/05/unicode-and-microsoft-dynamics-nav-2013.aspx#10492977Mon, 27 Jan 2014 11:11:59 GMT91d46819-8472-40ad-a661-2c78acb4018c:10492977Sebastiaan Lubbers<p>@Allan: The .NET 4.0 version StreamReader.Close also closes then Stream used in the constructor. Apparantly this also works for the Nav File type.</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10492977" width="1" height="1">re: Reading and Writing Unicode Files using C/ALhttp://blogs.msdn.com/b/nav/archive/2012/12/05/unicode-and-microsoft-dynamics-nav-2013.aspx#10492967Mon, 27 Jan 2014 10:39:43 GMT91d46819-8472-40ad-a661-2c78acb4018c:10492967Allan<p>Hi,</p>
<p>I have used this on NAV2013 but after upgrading to NAV2013R2 - this now gives an error: &quot;This message is for C/AL programmers: The call to member Dispose failed: Cannot access a closed file.&quot;</p>
<p>Have the way of Disposing changed?</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10492967" width="1" height="1">re: Reading and Writing Unicode Files using C/ALhttp://blogs.msdn.com/b/nav/archive/2012/12/05/unicode-and-microsoft-dynamics-nav-2013.aspx#10437663Mon, 29 Jul 2013 10:21:35 GMT91d46819-8472-40ad-a661-2c78acb4018c:10437663cheesecurly<p>useful :)</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10437663" width="1" height="1">re: Reading and Writing Unicode Files using C/ALhttp://blogs.msdn.com/b/nav/archive/2012/12/05/unicode-and-microsoft-dynamics-nav-2013.aspx#10419018Wed, 15 May 2013 18:54:46 GMT91d46819-8472-40ad-a661-2c78acb4018c:104190184BzSoftware<p>Hello, I got solution for Navision 2013 Table Fields Unicode Caption.</p>
<p>You can try it S#001 at my SkyDrive link <a rel="nofollow" target="_new" href="https://skydrive.live.com/redir?resid=1322D544FED91559!107&amp;authkey=!AI6BCiD--abnN8A">skydrive.live.com/redir</a></p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10419018" width="1" height="1">re: Reading and Writing Unicode Files using C/ALhttp://blogs.msdn.com/b/nav/archive/2012/12/05/unicode-and-microsoft-dynamics-nav-2013.aspx#10376010Mon, 10 Dec 2012 10:32:12 GMT91d46819-8472-40ad-a661-2c78acb4018c:10376010Urpo Kotipalo<p>Hello Hans, and thank you for sharing this with all of us!</p>
<p>I tested this in 2009R2 (with mscorlib version 2.0, obviously), and it seems to work somewhat after I changed the declaration of outStream to something like out_Stream, oStream or something else that is not a reserved word.</p>
<p>After this change I was able to write 3072 characters until the outstream dies on me and gives an error &quot;This message is for C/AL programmers: The call to member Dispose failed: Cannot access a closed file..&quot;</p>
<p>Do you happen to know how to fix this? I also have some problems in initiating the encoding part to use a specific codepage (ISO-8859-15) instead of those predefined ones (Unicode, UTF7, UTF8, UTF32)</p>
<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10376010" width="1" height="1">