You are here: Re: RTF export: UTF-8 to ANSI conversion? « All PHP « IT news, forums, messages
Re: RTF export: UTF-8 to ANSI conversion?

Posted by iktorn on 07/11/07 19:56

Markus napisał(a):
> Hello
>
> I try to write RTF files using text in UTF-8 encoding. Converting the
> text with utf8_decode() already fails on characters such as an
> apostrophe or an endash.
>
> So these are actually my questions:
> - Is there a good way to convert an UTF-8 string into CP1252, without
> losing the non-CP1252 character info? (mbstring is not available on that
> server)

You will always lose some characters wile converting utf-8 to encoding
that can handle up to 255 chars.

I haven't done anything related to RTF, but to convert UTF8 to CP-1252
you can use iconv library:
http://pl.php.net/manual/en/ref.iconv.php

with optional //IGNORE and //TRANSLIT modifiers

--
Wiktor Walc
http://phpfreelancer.net/en
Freelance PHP Developer

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация