# Convert ellipsis to utf-8

**URL:** <https://www.ruby-forum.com/t/convert-ellipsis-to-utf-8/195842>\
**Category:** Ruby\
**Created:** [October 1, 2010, 12:35am UTC](https://www.ruby-forum.com/t/convert-ellipsis-to-utf-8/195842 "2010-10-01T00:35:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahul\_Thathoo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ba8739/32.png) [@Rahul\_Thathoo](https://www.ruby-forum.com/u/Rahul_Thathoo)\
**Post date:** [October 1, 2010, 12:35am UTC](https://www.ruby-forum.com/t/convert-ellipsis-to-utf-8/195842/1 "2010-10-01T00:35:30Z")

</div>

Hi,

I have a string consisting of 3 periods: “…”. I want to convert it  
into a single utf-8 character

> **[HORIZONTAL ELLIPSIS (U+2026)](https://www.fileformat.info/info/unicode/char/2026/index.htm)**
>
> Get the complete details on Unicode character U+2026 on FileFormat.Info

I tried Iconv.iconv(‘utf-8’, ‘iso-8859-1’, ‘…’) but that didnt  
work… any clues?

---

<div class="post-metadata">

**Author:** ![Rahul\_Thathoo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ba8739/32.png) [@Rahul\_Thathoo](https://www.ruby-forum.com/u/Rahul_Thathoo)\
**Post date:** [October 1, 2010, 3:17am UTC](https://www.ruby-forum.com/t/convert-ellipsis-to-utf-8/195842/2 "2010-10-01T03:17:00Z")

</div>

On 01.10.2010 00:35, Rahul Thathoo wrote:

> I have a string consisting of 3 periods: “…”. I want to convert it  
> into a single utf-8 character [Unicode Character 'HORIZONTAL ELLIPSIS' (U+2026)](http://www.fileformat.info/info/unicode/char/2026/index.htm)
> 
> I tried Iconv.iconv(‘utf-8’, ‘iso-8859-1’, ‘…’) but that didnt  
> work… any clues?

I think I’d simply go with:

ruby-1.9.2-p0 \> puts “foo…bar”.gsub!(‘…’, “\u2026”)  
fooâ€¦bar

I wouldn’t except iconv() to know how to handle this. I’m not an expert  
but I’ve never seen a conversion creating “multiple characters”.  
“Multiple bytes”, yes, but not “characters”.

HTH,

- Markus
