Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Learn a Variety of Languages . . . . . . . (was: Re: [tlug] Re: Bourne Shell is the most appropriate scripting language)



On 1/16/07, Zev Blut <zb@example.com> wrote:
> Ruby still does not have proper Unicode support.

I have to ask how does Unicode support become a stopping point
for "Japanese" text processing?

I never said "stopping"... Simply Unicode support makes it easier to support Japanese processing.... or any other text processing. You never have to worry anymore...

In *standard python*, you can load up files in sjis, euc-jp, utf-8,
utf-16 convert them on the fly to Unicode for processing...

For example...

fh = file("sjisfile","rb")
content = fh.read().decode("sjis")
# then you can
print len(content), content[2]

will give you the string len and give you the second "character".

I don't know what would happen with standard ruby but the little I
have read is scary.

--- from http://wiki.rubyonrails.org/rails/pages/HowToUseUnicodeStrings ---
Note though that most of the methods return wrong results. Among the
methods which are not covered by jcode.rb (every use of these methods
in your application introduces a bug, sometimes including irreversible
damage to strings):

String#reverse
String#size
  ...
String#strip, String#rstrip and String#lstrip
String#slice
----------

I would say that Jim should try a simple program in both languages and
make an educated choice from his own experience.

cheers,

Guillaume


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links