<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Home</title><link>https://sourceforge.net/p/convertcp/wiki/Home/</link><description>Recent changes to Home</description><atom:link href="https://sourceforge.net/p/convertcp/wiki/Home/feed" rel="self"/><language>en</language><lastBuildDate>Mon, 10 Jun 2019 11:56:35 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/convertcp/wiki/Home/feed" rel="self" type="application/rss+xml"/><item><title>Discussion for Home page</title><link>https://sourceforge.net/p/convertcp/wiki/Home/?limit=25#d2c2</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;About Virtual Terminal processing for version 6.3 and newer&lt;/p&gt;
&lt;p&gt;Most of the current command line utilities don't support Virtual Terminal processing yet. In this case ANSI escape sequences are not used to control the console output and their textual expressions get printed to the screen.&lt;br/&gt;
Even if I expect that VT processing will be only barely used along with CONVERTCP, it won't hurt to enable it once that Windows 10 provides this possibility.&lt;br/&gt;
Example using CONVERTCP v. 6.3:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&amp;gt;nul chcp 65001
echo +ABsAWw-93;42m+JYgliCWIJZMlkyWTJZIlkiWSJZElkSWR-   +ABsAWw-0m|convertcp "UTF-7" "UTF-8"
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;img alt="" src="https://sourceforge.net/p/convertcp/screenshot/virtual_terminal_processing_v6.3.png"/&gt;&lt;/p&gt;
&lt;p&gt;Virtual Terminal processing affects the output to the console window only. Thus, CONVERTCP has to print to the window directly by omitting option /o and any redirections of the standard output stream. It's supported on Windows version 10.0.10586 onwards if the new console host is used.&lt;br/&gt;
The behavior on older Windows versions and for writing to files as well as for redirections keeps being the same as before.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Steffen</dc:creator><pubDate>Mon, 10 Jun 2019 11:56:35 -0000</pubDate><guid>https://sourceforge.netd0e08a66b7d473402815962ce76b2ed68cfc0885</guid></item><item><title>Discussion for Home page</title><link>https://sourceforge.net/p/convertcp/wiki/Home/?limit=25#7db3</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;How to verify if the conversion to another encoding was correct?&lt;/p&gt;
&lt;p&gt;Beginning with version 6.0, CONVERTCP supports option /v which influence the return value of the utility. If you pass /v, CONVERTCP verifies whether all characters from the input have been converted without  having used any replacement characters or approximated ASCII characters. Only in this case CONVERTCP returns 0. If one or more characters have been found that do not match the same Unicode code point in the used code page for the output, the return value will be 1.&lt;br/&gt;
Besides of that, CONVERTCP will still try to convert the text and will still silently replace invalid characters as in versions older than 6.0.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Steffen</dc:creator><pubDate>Sat, 13 Apr 2019 12:51:17 -0000</pubDate><guid>https://sourceforge.net636cde73175666e83233219bf923af60718fe6db</guid></item><item><title>Discussion for Home page</title><link>https://sourceforge.net/p/convertcp/wiki/Home/?limit=25#c4ac</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;How to find the right Code Page ID and why CONVERTCP doesn't detect code pages automatically&lt;/p&gt;
&lt;p&gt;The supported code pages depend on the installed code pages on your computer. Option /l lists the installed code pages along with a short description. A lot of these IDs are not self-explanatory though. If you're familiar with .NET or HTML you may already know some MIME names that are listed on the Microsoft page&lt;br/&gt;
&lt;a href="https://msdn.microsoft.com/en-us/library/dd317756.aspx" rel="nofollow"&gt;https://msdn.microsoft.com/en-us/library/dd317756.aspx&lt;/a&gt;&lt;br/&gt;
This table might be already helpful if you want to convert HTML source text. Usually the MIME name is given as charset attribute in the source and you can look up the related code page ID in the table.&lt;br/&gt;
But what if you don't know what the encoding of your source text is? Well, the best is if you get a handshake from the person who sent you the file. This person should tell you the encoding. Seriously, not even established text editors are able to reliably guess single-byte code pages (such as ANSI code pages) if they differ from your defaults.&lt;br/&gt;
What else can you do? Some encodings might use a Byte Order Mark. In a HEX Editor you'll see it as first byte sequence in a file. In Wikipedia you can find a table of what you may see (it's in the second column):&lt;br/&gt;
&lt;a href="https://en.wikipedia.org/wiki/Byte_order_mark#Byte_order_marks_by_encoding" rel="nofollow"&gt;https://en.wikipedia.org/wiki/Byte_order_mark#Byte_order_marks_by_encoding&lt;/a&gt;&lt;br/&gt;
The Unicode standard doesn't require Byte Order Marks though. Even in such cases a HEX editor could be useful. If you see an ASCII code followed by a 00 byte, then the next ASCII code followed by 00 etc. then you may consider the file is UTF-16 LE encoded. Vice versa (00 bytes first) would indicate UTF-16 BE. If you see a sequence of ASCII code and the first non-ASCII character consists of more than one byte then it's an indication for UTF-8.&lt;br/&gt;
Also the origin of a file might be of interest. If you know the file was created on a Linux distribution then the encoding is most likely UTF-8. ANSI encoded files may have the default encoding of the country they were created.&lt;br/&gt;
What if you get the name of the encoding but you don't know the related code page ID? I uploaded a list in "&lt;strong&gt;Code Page Aliases.pdf&lt;/strong&gt;". In the first column you will find several aliases, such as MIME names, IATA numbers, names used on different operating systems, and names used in different programming languages. Not all of them may exactly represent the Windows code pages of the second column (that you pass to CONVERTCP) but they should be at least close to these encodings.&lt;/p&gt;
&lt;p&gt;This is all quite complicated. So why is there no auto-detection implemented? It's because there is no real detection. It would be rather a guessing. As written above, ANSI encodings can't be guessed. Unicode encodings might be easy if the files have a Byte Order Mark. But if not, thousands of characters may have to read to evaluate the character values. Also heuristic or statistic methodes might have to be applied for guessings. That's how text editors act. But you can imagine that those things are only good for a text editor where it doesn't matter if it takes a second to guess an encoding (but may still fail). For a command line utility like CONVERTCP it would be a desaster. It would take ages if you call it for hundreds of files in a directory. And since guessing is still guessing you'd eventually like to blame me for corrupted or lost data.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Steffen</dc:creator><pubDate>Wed, 02 May 2018 23:56:21 -0000</pubDate><guid>https://sourceforge.netce019bd7acc49dc7d1a278354ffe72a03b5fa67f</guid></item><item><title>Discussion for Home page</title><link>https://sourceforge.net/p/convertcp/wiki/Home/?limit=25#3bbd</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Option /n explained&lt;/p&gt;
&lt;p&gt;The /n is for "no threading". But what does it mean?&lt;br/&gt;
For a better understanding let's step back to the defaults. As already written CONVERTCP reads the incoming stream chunk-wise. The advantage is that an already converted chunk can be written using an asynchronuous thread at the same time as the next chunk of text is read and converted. That leads to a good performance. Furthermore the memory usage is limited to the buffer size the chunks need. This size doesn't increase even not if very large files are converted. Sounds like a good concept, doesn't it? That's the reason why threading is used by default.&lt;br/&gt;
Things are getting complicated if the end of the read chunk is somewhere inside of a sequence of multiple bytes that represents a single character. There are charsets that have rules to recognize where the a character ends. I already use these rules for the processing of UTF-8 and UTF-16 streams in order to adjust the chunk boundaries accordingly. But there exist charsets without those rules. Such streams could get corrupted if their size exceed 1 MB (which is the default chunk size). If you list the code pages using option /l you'll find in the second column whether or not you can convert incoming streams greater than 1 MB without the risk of damaging their content. So the conclusion is that threading is not always as good as it seems to be.&lt;br/&gt;
That's the point where option /n comes in. This option leads to reading the whole file into the buffer. Due to internal limits of the used API functions the size of the incoming stream is still restricted. But now it's 511 MB rather than only 1 MB. The needed buffer size might increase tremendously. If you have only little RAM space the tool may crash (even if that should be quite unlikely on modern computers).&lt;/p&gt;
&lt;p&gt;tl;dr&lt;br/&gt;
Option /n might be of interest especially for large text encoded in UTF-7 or for people living in the eastern hemisphere (Chinese, Japanese, Korean people for example). If you are unsure if you need to pass option /n then first run CONVERTCP with option /l. If you find a "No" in the second column of the code page of your incoming stream AND the stream size (file size) is greater than 1 MB then use option /n for the conversion. If you need to convert a stream greater than 511 MB from such a code page then don't use CONVERTCP at all.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Steffen</dc:creator><pubDate>Thu, 26 Apr 2018 17:46:54 -0000</pubDate><guid>https://sourceforge.netd9f964501fafe3c348e687225a05de24162dae43</guid></item><item><title>Discussion for Home page</title><link>https://sourceforge.net/p/convertcp/wiki/Home/?limit=25#3191</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;About flushing the output stream&lt;/p&gt;
&lt;p&gt;Maybe you are wondering what the /f option is for. I have to admit you won't find much about it in the "readme.txt".&lt;br/&gt;
Flushing is basically not needed. Written data will be buffered by the file system because the physical writing to the drive is slow. That way the performance can be improved enormously. There is no drawback as long as the file is not accessed concurrently. Appending new data to the buffer by another write operation will not corrupt the data in the buffer. That's the reason why the default behavior of CONVERTCP is that the buffer will not be flushed automatically, also not before the file was closed. Converting multiple files in a loop keeps being very fast in that case.&lt;br/&gt;
This having said, there is still a risk just in case you immediately access the new file while there might be yet unwritten data in the buffer. E.g. if you convert a file using CONVERTCP in a script and you want to process the new file in the very next line of the script then you might get trouble because physical writing of the data to the drive may still take a few hundreds of milliseconds (even if the file was already closed). Option /f forces the buffer flushing before CONVERTCP terminates which should protect you from unwritten data. Even though this doesn't necessarily mean that the data was already written to the physical drive memory. Drives may have an additional buffer and it depends on the driver settings whether or not the request of Windows to flush that additional buffer will be ignored. The latter is nothing that I'm even able to influence and this possible behavior of a drive would also cause issues for other programs that write data to the drive.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Steffen</dc:creator><pubDate>Sun, 22 Apr 2018 15:58:24 -0000</pubDate><guid>https://sourceforge.netcf05aadbf2ab9b8986179c90c1a9c8facf0daf02</guid></item><item><title>Discussion for Home page</title><link>https://sourceforge.net/p/convertcp/wiki/Home/?limit=25#75bc</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;CONVERTCP and non-ASCII file names&lt;/p&gt;
&lt;p&gt;The source code of a Batch script have to be ASCII, or at least encoded encoded in the default OEM code page or the code page you have set using CHCP. However you'll get trouble to write file names that contain characters that are not supported. This is a limitation of the command interpreter. It's not a limitation of CONVERTCP as you may have observed while running my latest example above. So working with a wildcard character (like the asterisk) in a loop is already a good workaround.&lt;br/&gt;
But what if you only want to convert one single file with a file name that you can't write in a command line? There are parameter variables available in a batch script. E.g. the first parameter passed to the script can be found in %1. Exactly as the FOR variables in the other script parameter variables support Unicode, too. Just write your CONVERTCP command line using parameter %1 like that:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;@convertcp 1 65001 /b /i "%~1" /o "%~1.~tmp" &amp;amp;&amp;amp; move /y "%~1.~tmp" "%~1"
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Now you can drag and drop your text file onto the Batch script file even if it has such a weird name as  "𤽜€ЭÈ음.txt".&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Steffen</dc:creator><pubDate>Sun, 22 Apr 2018 15:06:29 -0000</pubDate><guid>https://sourceforge.nete4bed97bc6e7152d6404bf053e2ffab2744a69a5</guid></item><item><title>Discussion for Home page</title><link>https://sourceforge.net/p/convertcp/wiki/Home/?limit=25#db55</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Convert all files of a certain directory&lt;/p&gt;
&lt;p&gt;Not the build-in options make CONVERTCP flexible to use. It's rather the command-line interface. You don't need to drag every single file to a window, you also don't need to browse files or folders in a dialog window. Just use the possibilities that the windows command line already provide.&lt;br/&gt;
Say, you want to convert all .txt files in the current directory from your default ANSI code page to UTF-8 (similar to the example above) then you can just use a  FOR loop in a Batch script.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;for %%i in ("*.txt") do (convertcp 1 65001 /b /i "%%~i" /o "%%~i.~tmp" &amp;amp;&amp;amp; move /y "%%~i.~tmp" "%%~i")
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Steffen</dc:creator><pubDate>Sun, 22 Apr 2018 12:59:36 -0000</pubDate><guid>https://sourceforge.netde94c8e49b9e1a8b350a205717ca193ceb2dd776</guid></item><item><title>Discussion for Home page</title><link>https://sourceforge.net/p/convertcp/wiki/Home/?limit=25#6d08</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Replacing file content with the converted text&lt;/p&gt;
&lt;p&gt;I already wrote some examples in the "readme.txt" about how to convert a single file. You may ask why CONVERTCP doesn't support overwriting of a file with the converted content. The reason is that the tool doesn't read the entire content of the file at once. Especially for large files it's more memory-efficient to read only chunk-wise in order to avoid running out of RAM space. This also makes that CONVERTCP shows a pretty high performance because as long as a chunk of text is read and converted, the former chunk can be written to the new file at the same time. You can imagine that writing to and reading from the same file and at the same time would corrupt the file. Also what if the conversion fails for whatever reason? You may lose your data. Good practice is to write to a temporary file and only overwrite the file if the conversion succeeded.&lt;br/&gt;
Example for a BAT or CMD script:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;convertcp 1 65001 /b /i "test.txt" /o "test.txt.temp~"
if not errorlevel 1 move /y "test.txt.temp~" "test.txt"
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Don't worry about the MOVE command. There is no physical moving of data performed as long as the file is moved on the same logical drive. Only the file addressing will be updated.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Steffen</dc:creator><pubDate>Sun, 22 Apr 2018 12:44:06 -0000</pubDate><guid>https://sourceforge.net4453aa97a2a33867b576dc51010dab6e28e13dcf</guid></item><item><title>Home modified by Steffen</title><link>https://sourceforge.net/p/convertcp/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -1,8 +1,6 @@
-Welcome to your wiki!
+Welcome to the CONVERTCP project!

-This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: [SamplePage].
+You may have realized that I didn't start this project on SOURCEFORGE. If you're interested in the history of CONVERTCP (which already began  in 2016) and in some further explanations then please visit this forum thread:
+[CONVERTCP.exe - Convert text from one code page to another](https://www.dostips.com/forum/viewtopic.php?f=3&amp;amp;t=7570)

-The wiki uses [Markdown](/p/convertcp/wiki/markdown_syntax/) syntax.
-
-[[members limit=20]]
-[[download_button]]
+Steffen
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Steffen</dc:creator><pubDate>Sat, 21 Apr 2018 21:30:16 -0000</pubDate><guid>https://sourceforge.netf8a4c68637f2abfd1baaeb57da1fcd035552fedf</guid></item><item><title>Home modified by Steffen</title><link>https://sourceforge.net/p/convertcp/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Welcome to your wiki!&lt;/p&gt;
&lt;p&gt;This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: &lt;span&gt;[SamplePage]&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;The wiki uses &lt;a class="" href="/p/convertcp/wiki/markdown_syntax/"&gt;Markdown&lt;/a&gt; syntax.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;h6&gt;Project Members:&lt;/h6&gt;
	&lt;ul class="md-users-list"&gt;
		&lt;li&gt;&lt;a href="/u/german-one/"&gt;Steffen&lt;/a&gt; (admin)&lt;/li&gt;
		
	&lt;/ul&gt;&lt;br/&gt;
&lt;p&gt;&lt;span class="download-button-5adb5cfbda752c1581065b54" style="margin-bottom: 1em; display: block;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Steffen</dc:creator><pubDate>Sat, 21 Apr 2018 15:47:07 -0000</pubDate><guid>https://sourceforge.netfdc1fda4f5c55cf2ca9b0f71920a39239d1ec505</guid></item></channel></rss>