Talk:Reverse a string: Difference between revisions

From Rosetta Code
Content added Content deleted
No edit summary
Line 11: Line 11:


:I am so relieved ''not'' to have to delve any further into Unicode. Whilst doing my background reading, I could not help but think that the margins were littered with little arrows and in much smaller text <small>Here be Dragons</small>. :-) &nbsp; --[[User:Paddy3118|Paddy3118]] 16:35, 28 July 2009 (UTC)
:I am so relieved ''not'' to have to delve any further into Unicode. Whilst doing my background reading, I could not help but think that the margins were littered with little arrows and in much smaller text <small>Here be Dragons</small>. :-) &nbsp; --[[User:Paddy3118|Paddy3118]] 16:35, 28 July 2009 (UTC)

:What unicode characters should be handled? For example in ShinTakez' resolution of the issue in R it was assumed that the unicode character meant was not either of the specials, U+FFFC or U+FFFD; is that a reasonable assumption?

Revision as of 18:50, 28 July 2009

Extra Credit?

Does any example go for the extra credit Unicode combining characters? It seems to have been introduced [here] by Kevin Reid, but I am not sure that even his [E example] goes for the extra credit. --Paddy3118 04:35, 28 July 2009 (UTC)

Nobody's tackled it since the requirement was introduced. It's moderately tricky too IIRC, as it gets into the whole problem of normalization of strings. —Donal Fellows 08:07, 28 July 2009 (UTC)
I've cooked up something that works for the given Unicode string in Python and I have tried to make it generic, but the more I read about Unicode, the more I know I don't know :-)     --Paddy3118 08:30, 28 July 2009 (UTC)

I have found the data table, (license), that is embedded in the Python module on-line. Should I split the task and have the stretch goal as a task on its own? (parse the table if needed, reverse a unicode string using the info from the table/an internal function with the combining info). --Paddy3118 09:20, 28 July 2009 (UTC)

About my addition: Yep, it's often tricky, and that's why I said "extra credit". The thing is, if you don't do it, you get nonsense from certain Unicode strings; this will become increasingly relevant as the world drifts away from the habits of ASCII-and-a-few-extras. So I added this to spread a little Unicode-handling-awareness (though this isn't even complete: there are also e.g. bidirectional formatting markers, which need even more complicated handling). And that's why I think it shouldn't be a separate task: it's not a different problem, it's more correctness (unless the string you're reversing is not really text, in which case you're looking for binary tasks). --Kevin Reid 12:03, 28 July 2009 (UTC)

I am so relieved not to have to delve any further into Unicode. Whilst doing my background reading, I could not help but think that the margins were littered with little arrows and in much smaller text Here be Dragons. :-)   --Paddy3118 16:35, 28 July 2009 (UTC)
What unicode characters should be handled? For example in ShinTakez' resolution of the issue in R it was assumed that the unicode character meant was not either of the specials, U+FFFC or U+FFFD; is that a reasonable assumption?