Previous Thread
Next Thread
Print Thread
Hop To
Joined: Oct 2006
Posts: 23
K
newbie
newbie
K Offline
Joined: Oct 2006
Posts: 23
I just made a post which contains accented characters in it:

https://www.ubbcentral.com/forums/ubbthreads.php?Number=165052

I notice that although the characters display correctly when viewing the post, they do not display correctly when you hit "Preview Post".

To reproduce, try writing something like "instrucción" in a reply and hitting "Preview Post". How you actually type an accented character on your keyboard is left as an exercise to the reader; I only know how to do it on a Spanish, Mac keyboard (hit ´ followed by a vowel key).

This is on Safari 2.0.4 running on Mac OS X 10.4.8 (although I don't think the browser has anything to do with the bug).

Last edited by Rick; 11/03/2006 8:31 PM.
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Hmm, I'll need to test on a Mac and see if I can fix this. It works ok in Mozilla Firefox and IE 7 on Windows.

Joined: Jun 2006
Posts: 956
Old Hand
Old Hand
Joined: Jun 2006
Posts: 956
Seems to be another problem related to this. If you use quick quote german special chars (umlaute öäüß) were be encoded to unicode but this dont fit with the codepage. If you read the post you dont see the decoded chars, you see the code itself


my board: http://www.dragonclan-forum.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
Joined: Jun 2006
Posts: 162
M
enthusiast
enthusiast
M Offline
Joined: Jun 2006
Posts: 162
I've got the same problem:
Special chars problem in preview

Strange that is works here, but not on my installation.


##eek##
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
I'm toying with changing the default encoding to utf-8. This seems to fix the quickquote issue. Can you edit your generic.php language file and give it a shot and see if this fixes the issues on your site?

Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Unfortunately it seems that changing to utf-8 will mangle those special characters when files are being written to the server.

Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Ok, I belive this will fix the quick quote issue. Edit your scripts/quickquote.inc.php file. Line 85 has this:

echo $post_body;

Change that, to this:

echo utf8_encode($post_body);

This seems to fix it and so far hasn't caused any other issues with quoting any other characters, but still testing.

Joined: Jun 2006
Posts: 956
Old Hand
Old Hand
Joined: Jun 2006
Posts: 956
Yes Rick, looks good. Problem solved.

Changing the language code in generic is a bad idea. You run in trouble with old posts if you do this.


my board: http://www.dragonclan-forum.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
Joined: Oct 2006
Posts: 23
K
newbie
newbie
K Offline
Joined: Oct 2006
Posts: 23
Seems to work. Will report back if I find any problems.

Joined: Jun 2006
Posts: 162
M
enthusiast
enthusiast
M Offline
Joined: Jun 2006
Posts: 162
Originally Posted by Rick
quickquote.inc.php
Hmmm. Quoting with umlauts worked well for me before. When using quick quote with that fix, it gives me the same wrong characters like in the preview.

I tried to apply utf8_encode in previewpost.inc.php also, but this makes it even worse. In preview an ö was ö before. Now it is ö


##eek##
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
What encoding are you currently using in your language file? This sounds pretty much like what I encountered when I was testing utf-8 for the encoding.

Joined: Jun 2006
Posts: 956
Old Hand
Old Hand
Joined: Jun 2006
Posts: 956
I test it with FF and IE 6.01 on a german board. I use charset=iso-8859-1 for my german language page. It worked on my site without problems. Do yue try to clear out the cache of the board and the browser? Close browser and reopen.


my board: http://www.dragonclan-forum.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
Joined: Jun 2006
Posts: 162
M
enthusiast
enthusiast
M Offline
Joined: Jun 2006
Posts: 162
Standard "iso-8859-1". I tried iso-8859-15 and UTF-8 before, but I'm back to iso-8859-1. Tried with Firefox and IE. Cleared browser cache, forum cache and deleted the templates/compile directory.

Well, it's just the preview that does not work on my server. Here at ubbcentral its fine. Does the preview work for you, Zarzal?


##eek##
Joined: Jun 2006
Posts: 956
Old Hand
Old Hand
Joined: Jun 2006
Posts: 956
yes, worked, see picture
Attachments
184-quickquote.jpg


my board: http://www.dragonclan-forum.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
Joined: Oct 2006
Posts: 23
K
newbie
newbie
K Offline
Joined: Oct 2006
Posts: 23
Originally Posted by Rick
What encoding are you currently using in your language file? This sounds pretty much like what I encountered when I was testing utf-8 for the encoding.

For reference, I'm just using an English-language board with all default settings, and I haven't touched any encodings.

For me the utf8_encode() tweak in quickquote.inc.php fixed my problems with the preview. The "QUICK QUOTE" button also works; I have no idea if it used to work before or not. I also have no idea why editing quickquote.inc.php (not previewpost.inc.php) fixed previewing...


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Is UBB.threads still going?
by Aaron101 - 04/01/2022 8:18 AM
Who's Online Now
0 members (), 764 guests, and 261 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)