# Re: Gedankenexperiment on method duck type safety

**URL:** <https://www.ruby-forum.com/t/re-gedankenexperiment-on-method-duck-type-safety/127741>\
**Category:** Ruby\
**Created:** [January 31, 2008, 9:14pm UTC](https://www.ruby-forum.com/t/re-gedankenexperiment-on-method-duck-type-safety/127741 "2008-01-31T21:14:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e95f7d/32.png) [@phil](https://www.ruby-forum.com/u/phil)\
**Post date:** [January 31, 2008, 9:14pm UTC](https://www.ruby-forum.com/t/re-gedankenexperiment-on-method-duck-type-safety/127741/1 "2008-01-31T21:14:26Z")

</div>

hi,

i’m curious if there is a better (in the means of faster) way to  
transform an utf8 encoded string to ascii, than this

str.unpack(‘U\*’).pack(‘c\*’)

g phil
