PHP: Textile giving me single quotes instead of apostrophes

PHP: Textile giving me single quotes instead of apostrophes

柳若烟 发布于 2021-11-29 字数 745 浏览 834 回复 3 原文

I'm using v2.0 of ClassTextile.php, with the following call:

$testimonial_text = $textile->TextileRestricted($_POST['testimonial']);

... and all of my apostrophes (ex. It's hot in here) are being translated to ASCII (which is a single quote, which slopes the wrong way). What it should be is ASCII . I've also tried using TextileThis() and I have the same problem.

If I go and try it on Textile's website (http://textile.thresholdstate.com/), it gives the correct ASCII code. So why isn't it working with the downloadable library? Or am I doing something wrong?

如果你对这篇文章有疑问,欢迎到本站 社区 发帖提问或使用手Q扫描下方二维码加群参与讨论,获取更多帮助。

扫码加入群聊

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

记忆消瘦 2022-06-07 3 楼

Tried this again and it works. Weird.

Have since switched to Markdown, regardless. Ah well.

怼怹恏 2022-06-07 2 楼

Hmm code looks clean, I would suggest passing in the POST and a variable instead of directly just to see if there is some kinda bug. I don't think the results will change just ruling out that option.

$var = $_POST['testimonial'];
$testimonial_text = $textile->TextileRestricted($var);
仅冇旳回忆 2022-06-07 1 楼

Have you really copy-pasted the text from your source code to the form on their website? If this still yields the same result, you should probably upgrade your version.