Yes I have. Many interesting features. Most of them not good enough to be considered killer, IMO. What are your suggestions?
Yes I have. Many interesting features. Most of them not good enough to be considered killer, IMO. What are your suggestions?
say "ปฏิบัติจริง".chars; # says 7 [1]
Perl 6 may be a game changer in years to come among those who need to munge text that's Thai, Chinese, etc.http://www.reddit.com/r/perl/comments/2szv7m/beginner_progra...
import unicodedata
def count_graphemes(string):
count = 0
for codepoint in string:
if not unicodedata.category(codepoint).startswith('M'):
count += 1
return count
print(count_graphemes("ปฏิบัติจริง")) # prints 7
This example is over simplified as grapheme clusters are trickier to detect, but proper support is coming to Python's standard library: http://bugs.python.org/issue18406----
Would you agree that you are saying that you think it's OK that:
* The appropriate long term solution is to use library code when doing character or substring level operations on arbitrary Unicode text;
* Language implementors have generally not yet written said library code;
* The built in character and substring operations in mainstream languages unpredictably misinterpret and corrupt international text such as Thai, Chinese, etc.;
* The current solution for correct, non-corrupting character and substring handling of arbitrary Unicode text is to hand build custom code to do things like get the length of a string or replace a substring.
If you disagree with the above, then I'm confused.
If you agree, then you're in agreement with most folk and I think you and they are blind to the needs of regular folk who need to handle, say, Chinese text, and these latter folk will find the simple and correct built in character and substring handling in Perl 6 to be one of its killer features.