From: Dmitry Severin Date: 2006-06-21T23:56:47+09:00 Subject: Re: Unicode roadmap? ------=_Part_150367_30743617.1150901804562 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 6/21/06, Yukihiro Matsumoto wrote: > > > For only rare case, there might be need to handle multiple encoding in > an application. I do want to allow it. But I am not sure how we can > help that kind of applications, since they are fundamentally complex. > And we don't have enough experience to design a framework for such > applications. > > I can see one more problem with setting encoding per file and tagging accordingly string literals in it. If operations on strings with different encodings will always throw an exception, problems can raise when one calls such third-party library from script with different encoding. Here's small example: library code in file some_utility.rb: # -*- coding: EUC-JP -*- module SomeUtility def SomeUtility.fancy_format(str) "" + str + "" # these literals are tagged as EUC-JP, right? end end application code in file my_app.rb: # -*- coding: UTF-8 -*- require 'some_utility' puts SomeUtility.fancy_format("an utf8 string") # this literal is tagged as UTF8 If the last call will throw some kind of EncodingMismatchError, how to deal with that? ------=_Part_150367_30743617.1150901804562--