Main points of proposal
Reported by Hector E. Gomez Morales | March 25th, 2009 @ 12:07 AM | in Proposal Deadline
- 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.
Comments and changes to this ticket
-
Manfred Stienstra March 25th, 2009 @ 04:38 PM
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
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Proposal for the implementation of ActiveEncoding library that will make transparent the manipulation of string of different encodings (compatible and not compatible).