Oznámení

Provoz fóra byl ukončen

Odd characters post process

před 12 lety

thehuby
Člen | 2

Sorry as I don't speak Czech and have not been able to search for a solution to my issue.

I am trying to implement texy in a custom CMS. I have previously been using Markdown.

I am calling the process function and passing it a form entry from a text field, however when I print the HTML it is full of non-standard English characters. Can anyone give me an idea of what I am doing wrong?

I have included an example below.

<ul>
<li>very long words division (with respect for language rules). Example:
antidisestablishmenÂtarianism</li>

<li>clickable emails and URL <a href="http://www.dgx.cz">www.dgx.cz</a>, <a href="mailto:dave@dgx.cz">dave@<!---->dgx.cz</a>

(emails are obfuscated against spambots)</li>

<li>„nationalâ€&#339; ‚typographicâ€&#732; quotes</li>

<li>divider vs. dash: 10–15 vs. north-west</li>

<li>en-dash: oneÂ&nbsp;– two</li>

<li>dimension sign 10&#195;—20</li>

<li>nonbreakable spaces in phone numbers +420Â&nbsp;776Â&nbsp;552Â&nbsp;046</li>

<li>acronym <acronym title="North Atlantic Treaty Organisation">NATO</acronym></li>

<li>abbr „et al.â€&#339;((and others))</li>

<li>quickCorrects like thisâ„&#162; this® or ©this</li>

<li>arrows â†&#65533; and → and ↔ ;</li>

<li>ellipsis…</li>

<li>preserve HTML entities</li>

<li>and many others :-)</li>
</ul>

před 12 lety

David Grudl
Nette Core | 6806

The output text is encoded in UTF-8 (by default). If you are using another encoding (e.g. ISO-8859–1), you must specify the encoding:

$texy = new Texy;
$texy->encoding = 'ISO-8859-1';
$html = $texy->process($text);

před 12 lety

thehuby
Člen | 2

Thanks for that – thats resolved the issue for me.

Regards,

Rick
www.rickhuby.com