Talk:Reverse a string

From Rosetta Code
Revision as of 12:03, 28 July 2009 by rosettacode>Kevin Reid (→‎Extra Credit?: why I did what I did)

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. 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)