En/Je/On 2012-11-16 14:41, Simon Owen escribió / skribis / wrote : > I'll add file spooling for non-Windows platforms, and clipboard paste > once SDL 2.0 is supported.
Great! It will be possible to code in MasterBASIC with a modern editor. Cannot wait to try it :) > The Windows version will likely remain > clipboard only, since sniffing the encoding from text files is just > too unreliable. I don't use Windows, but your comment about file encoding makes me think the text is converted before "auto-typing" it. Isn't it? I mean non-ASCII characters. When I wrote my MBim toolkit I considered how to write SAM-specific characters in the source (e.g. block graphics and UDG) and non-ASCII charers whose code is different from the current 8-bit standards like ISO-8859-1. I solved the first problem with the simple notation used by BASin (the old ZX Spectrum IDE for Windows). For the second, I simply used ISO-8859-1 in the source. Then my Vim converter translated everything, the BASin notation and the ISO-8859-1 non-ASCII characters, to the actual SAM characters. The text was ready to be KEYIN-ed. So far so good. But I think automatic translation during spooling has some drawbacks: first, it would be useful only for non-ASCII characters (mainly, foreign language letters) provided by the SAM (mainly, by MasterBASIC) --or for all characters, in case the file is encoded in any ASCII-incompatible format, e.g. UTF-16, what is not common; second, it could ruin an ad hoc character translation done by the programmer in the source. Example: The charset provided by MasterBASIC lacks four Spanish letters (uppercase Á, Í, Ó and Ú). If I use them in the source (I mean, in the texts managed by the program; the comments are irrelevant), I'd have to choose what character codes must represent them, how to translate them before spooling and finally how to design those missing chars as UDG. Automatic translation doesn't help because those characters are not part of the SAM charset, and my own characters codes could be misunderstood by the file spooler as part of an UTF-8 multibyte character. Therefore, in my opinion, a simple and versatile option could be: first, assuming the spool file is encoded in an 8-bit ASCII-compatible charset (the actual encoding is irrelevant); and second, feeding it "as is" to the SAM, without translation (of course beside end of line and maybe other control characters). Marcos -- http://programandala.net
