HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Smart Quotes

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#41561 (In Topic #9306)

Fan in training

I honestly have no idea where to ask about this, so I hope this is the right place.

Anyway. It appears that ocPortal only supports the straight " quotation marks and ' apostrophes. That's fine for when you are typing something straight into the reply box, however, one of the things I want to offer on my site is the ability for users to be able to post stories they've written, most of the time in Word or a similar text editor. Most of these text editors use Smart Quotes, the ones that are curved to fit around your sentence or whatever, and when you past text into the text box with them, they appear, but when you fit submit, it cuts them out.

I have not been working long with ocPortal, we just installed it end of last week, so I have no idea how to go about making this so it either changes all quotation marks and apostrophes to the straight ones, or just add in support for the Smart Quotes.

Thanks in advance.
- Juesoni
Back to the top
 
Posted
Rating:
#41578
Avatar

Hi,

This is being caused by an apparent flaw in the PHP mbstring extension (ocPortal uses this extension when available to try and support different character sets properly).

I have a fix (works for either v3 or v4). Change line 67 of sources/lang.php from:

Code

                        $encoding=mb_detect_encoding(urldecode(ocp_srv('REQUEST_URI')),'UTF-8, UTF-7, ASCII, EUC-JP,SJIS, eucJP-win, SJIS-win, JIS, ISO-2022-JP, ISO-8859-1');
to:

Code

            $encoding=mb_detect_encoding(urldecode(ocp_srv('REQUEST_URI')),do_lang('charset').',UTF-8,ISO-8859-1');

(For reference this problem only affects users with the PHP mbstring extension enabled)


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#41600

Fan in training

Thanks! Worked like a charm.  :thumbs:

- Juesoni
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: