Hi all
Some time ago I found a bug in Radio relative to stressed chars
(אטילעש and so on) aka High ASCII chars, opml and macOs.
I discovered it using activeRenderer Marc Barrot tool but it should
affect any opml even saved through other renderers.
I notified tu UL some time ago, and Jake confirmed me it looked as I
had fixed it. He had to check suggested fix and then he was going to
release it, but either it didn't pass his test, or he hadn't time to
release the update.
Userland guys have got much to do and I can understand they posponed this fix.
As many people asked to have this problem solved I am publishing my
fix here, but anyone applying it be warned he does it at his own
risk, no warranty is given on it. It may be overwritten from
successive UL updates to involved functions too.
Anyway I have been working with fixed functions since a month and
apparently had no problem.
Here is the bug and the fix:
system.verbs.builtins.radio.webServer.buildPage, that is called when
uploading changed files, reads opml files from disk and translates
the opml file text without doing string.latinToMac under macOS...
this has the opml rendered and uploaded with all stressed chars
translated to ugly text or chars.
I fixed it adding just a pair of lines in
system.verbs.builtins.radio.webServer.buildPage:
Current code:
if pta^.radioResponder.fileMimeType == "text/x-opml" {
op.xmlToOutline (filetext, @filetext)}
Modified code:
if pta^.radioResponder.fileMimeType == "text/x-opml" {
if system.environment.isMac { // take care of Mac encoding
filetext = string.latinToMac(filetext)};
op.xmlToOutline (filetext, @filetext)}
This fixes the problem on my Mac ;)
A similar problem seems to affect
system.verbs.builtins.radio.file.getFileAttributes in the following
lines:
case mimetype {
"text/x-opml" {
op.xmlToOutline (file.readwholefile (f),
@adrcache^.outline);
html.runOutlineDirectives
(@adrcache^.outline, adrcache);
if window.isOpen (@adrcache^.outline) {
//work around a kernel bug
window.close (@adrcache^.outline)}};
Here op.xmlToOutline compiles a opml with all stressed chars wrong.
Suggested fix:
case mimetype {
"text/x-opml" {
local (filetext = file.readwholefile (f));
if system.environment.isMac { // take care of
Mac encoding
filetext = string.latinToMac(filetext)};
op.xmlToOutline (filetext, @adrcache^.outline);
html.runOutlineDirectives
(@adrcache^.outline, adrcache);
if window.isOpen (@adrcache^.outline) {
//work around a kernel bug
window.close (@adrcache^.outline)}};
--
Simone
---------------------------------------------------------------
"The web was built with hypertext, not hypergraphics."
Jeffrey Zeldman
---------------------------------------------------------------
weblog: http://simone.blogs.it
---------------------------------------------------------------