Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Main points of proposal

#1
  • Separate this new feature as a standalone library (ActiveEncoding) instead of adding more code to ActiveSupport.
  • This implementation will only focus in compatibility with ruby 1.9. Compatibility for ruby 1.8 will continue to be handled by the existing MultiByte code in ActiveSupport.
  • Framework wide configuration for encoding.
  • Following the Convention over Configuration paradigm, the most sensible default for most applications is:

    • Default to UTF-8 encoding
    • Transparent trascoding of any input string to UTF-8 if needed.
  • Enable the definition of levels of strictness in the transcoding of strings:

    • Strict: Any non-valid transcode raises an exception.
    • Pragmatic: Attempts to do a full transcode of string. If a valid transcode is not entirely possible a partial transcode is done.
    • Ignore: Ignores string and returns a canned string.
    • Logging of the line, source, string, etc involved in the event of an invalid transcode is enabled by default for all levels
  • This will touch all the components in the framework. With 3 months of development I think there is a need to focus to only a subset of all the framework

    • Full integration to controller views (ActionPack).
    • If there is time begin the incorporation of the functionality to the other components in Rails.

Reported by Hector E. Gomez Morales · March 25th, 2009 @ 12:07 AM

State: new
Milestone: Proposal Deadline

Activity

  1. Manfred Stienstra
    Manfred Stienstra

    This implementation will only focus in compatibility with ruby 1.9. Compatibility for ruby 1.8 will continue to be handled by the existing MultiByte code in ActiveSupport.

    Note that Multibyte doesn't do any transcoding and basically just assumes the encoding of the string is UTF-8 once you call any methods on it. In theory we could bolt on an encoding attribute to the 1.8 String class but let's exclude this from the project, the only requirement is that Rails stays working on 1.8.

    Enable the definition of levels of strictness in the transcoding of strings:

    I guess good names for these would be: strict, transcode, and ignore. Something like this:

    
    config.active_encoding.handle_incompatible_characters = :strict
    config.active_encoding.handle_incompatible_characters = :transcode
    config.active_encoding.handle_incompatible_characters = :ignore
    

    March 25th, 2009 @ 04:38 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.