# Code Review: Encodingsa1

**URL:** <https://www.ruby-forum.com/t/code-review-encodingsa1/167469>\
**Category:** IronRuby\
**Created:** [May 8, 2009, 1:14am UTC](https://www.ruby-forum.com/t/code-review-encodingsa1/167469 "2009-05-08T01:14:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![grujildo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Post date:** [May 8, 2009, 1:14am UTC](https://www.ruby-forum.com/t/code-review-encodingsa1/167469/1 "2009-05-08T01:14:21Z")

</div>

tfpt review “/shelveset:EncodingsA1;REDMOND\tomat”  
Comment :  
Implements IsAscii() on MutableString - the bit is calculated along  
with hashcode and invalidated each time a mutable operation is  
performed.  
Enables combination of mutable strings with different  
encodings/KCoding. If a string is k-coded it should be treated as byte  
array for all operations since 1.8 doesn’t tag the strings with  
encodings. Hence any k-coded strings can be combined regardless of their  
actual encodings. 1.9-encoded strings must have the same encoding or one  
of them must have all characters in range 0…127 (IsAscii == true) - MRI  
1.9 allows combination of such strings.

Fixes:

- “IronRuby ignores RUBYLIB environment variable”  
[http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=718](http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=718)
- Encoding wasn’t flowing correctly in eval (test Encoding4)
- Improves performance of String#\*.
- MutableString.Content.GetCapacity was wrong.

Tomas
