|
||||
|
|
OOTP 22 - General Discussions Everything about the brand new 2021 version of Out of the Park Baseball - officially licensed by MLB and the MLBPA. |
![]() |
|
Thread Tools |
![]() |
#1 |
Minors (Rookie Ball)
Join Date: Apr 2015
Posts: 47
|
Spanish letters in Reports
We just converted our online league to 22 this weekend. I generated and uploaded reports for the first time on 22. All of the Spanish characters in the uploaded reports are "corrupted" for lack of a better word. For instance, Jose Gonzalez name looks like José Gonzáles
Has anyone experienced this or have thoughts on a setting that might need to get tweeked? |
![]() |
![]() |
![]() |
#2 |
Minors (Rookie Ball)
Join Date: Apr 2015
Posts: 47
|
I'll answer my own question here in case anyone else comes across this. Solution is copying Templates folder from data to league folder, modifying the head_bits.tpl file and adding a meta tag:
<meta charset="UTF-8" /> |
![]() |
![]() |
![]() |
#3 |
All Star Reserve
Join Date: Nov 2020
Posts: 658
|
So just adding that line makes all the weird names go away? And you just discovered and did that on your own?
|
![]() |
![]() |
![]() |
#5 |
Administrator
Join Date: Jun 2002
Location: Hollern/Stade/Germany
Posts: 8,992
|
Thank you, ronnieh. This is indeed a fix for this problem especially for older leagues or for leagues with custom tpl files, who have an extra folder /templates inside the league folder.
OOTP 22 comes with a template file head_bits.tpl which contains these lines: PHP Code:
This works for me when testing with spanish and other letters. If you have problems with those letters, make sure that your file /templates/head_bits.tpl contains that UTF-8 line. Also check your league folder: if there's a sub folder /templates, then this league uses it's own templates and you'll need to update them (if you want to use the default templates which came with OOTP 22, just rename or delete that custom folder). Last edited by Andreas Raht; 08-19-2021 at 03:32 AM. |
![]() |
![]() |
![]() |
#6 | |
Hall Of Famer
Join Date: Aug 2009
Location: NJ, US
Posts: 2,003
|
I am getting the same thing in my HTML reports. The league is an old league but it does NOT have a template folder in the league folder and template folder above the league folder has the head_bits.tpl file with the two lines mentioned above.
Anyone have any other suggestions to fix this?
__________________
Quote:
|
|
![]() |
![]() |
![]() |
#7 | |
Administrator
Join Date: Jun 2002
Location: Hollern/Stade/Germany
Posts: 8,992
|
Quote:
Does the resulting HTML page also have the "UTF-8" line in the header, when you look at the source code of the page? Problem could be that the player name is saved in an old format. Can you edit the player name and copy/paste the correct letters into OOTP and see if that fixes it for this player? |
|
![]() |
![]() |
![]() |
#8 |
Minors (Double A)
Join Date: Mar 2007
Location: around the corner from Mays Field
Posts: 194
|
I'm having the same issue - the template file has the correct code, and player names are correct in the editor, yet the web pages are still a mess...
|
![]() |
![]() |
![]() |
#9 | |
Hall Of Famer
Join Date: Aug 2009
Location: NJ, US
Posts: 2,003
|
Yes the template file has the code, the index.html on the website has the code and in-game the player name is correct.
__________________
Quote:
|
|
![]() |
![]() |
![]() |
#10 |
Minors (Double A)
Join Date: Mar 2007
Location: around the corner from Mays Field
Posts: 194
|
We, too, continue to see the names all mucked up - we copied the template folder as mentioned above and our file has the UTF-8 code in it as well, yet the newly generated reports still have the names all messed up.
Such as Pablo |
![]() |
![]() |
![]() |
#11 |
Minors (Double A)
Join Date: Sep 2012
Posts: 186
|
Try adding exactly the tag below to the HTML files (not the existing one with <meta name="content-type" content="text/html;charset=UTF-8">), and the accented characters should show up. It's worked for many leagues I've helped out.
Code:
<meta charset="utf-8"> This isn't a fix for older leagues or ones with custom templates, it's needed in OOTP22 reports unless you have a web server that's adding additional information.
__________________
StatsPlus - Desktop tool for OOTP real-time sim integration with Slack (Windows, Mac, and Linux) USBA - OOTP online promotion/relegation league Last edited by silverwolf; 08-27-2021 at 03:14 PM. |
![]() |
![]() |
![]() |
#12 | |
Hall Of Famer
Join Date: Aug 2009
Location: NJ, US
Posts: 2,003
|
Tried editing the player name and made no difference
__________________
Quote:
|
|
![]() |
![]() |
![]() |
#13 | |
Hall Of Famer
Join Date: Aug 2009
Location: NJ, US
Posts: 2,003
|
OK, finally got the names to display correctly.
I added the <meta charset="UTF-8" /> line to the header_bit.tpl and regenerated/uploaded reports but this did not correct the issue and the new UTF line was not showing in the HTML that was generated. After trying some other things it was suggested that I restart OOTP and when I did this and no other changes (above UTF-8 line in the header_bits.tpl file) and regenerated reports again it worked! My guess is that OOTP cached the header_bits.tpl file so when I added it in the file without restarted OOTP the update didn't get used. But all is good now.
__________________
Quote:
|
|
![]() |
![]() |
![]() |
#14 | |
Hall Of Famer
Join Date: Aug 2009
Location: NJ, US
Posts: 2,003
|
Andreas, could we get the <meta charset="UTF-8" /> line added in the source header_bits.tpl file so that online leagues don't need to go in an manually do it, especially if a patch updates the template files)?
__________________
Quote:
|
|
![]() |
![]() |
![]() |
#15 | |
Global Moderator
Join Date: Dec 2001
Location: Oconomowoc, WI
Posts: 2,768
|
Quote:
__________________
Matt Rectenwald Commissioner, GM: Las Vegas Hustlers, The Brewster Baseball Association- fictional league (JOIN NOW) |
|
![]() |
![]() |
![]() |
#16 |
Hall Of Famer
Join Date: Jul 2003
Location: Somerville, MA, USA Bats: Right Throws: Left
Posts: 3,624
|
Thanks. This came in handy today.
[I take it back. It didn't work] Last edited by andjbock; 01-11-2024 at 09:03 PM. |
![]() |
![]() |
![]() |
#17 |
Hall Of Famer
Join Date: Jul 2003
Location: Somerville, MA, USA Bats: Right Throws: Left
Posts: 3,624
|
Can anyone who has solved this take a quick look at my code to see if anything is preventing my characters from properly converting?
https://ootp.biz/mlb/players/player_28070.html view-source:https://ootp.biz/mlb/players/player_28070.html HTML Code:
<!DOCTYPE HTML> <html> <head> <title>Player Report for #27 Román 'Boom Boom' Tañón</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" type="text/css" href="../styles.css"> <link rel="stylesheet" type="text/css" href="../mlb.css"> ******** src="https://code.jquery.com/jquery-3.4.1.min.js"></script> ******** src="../scripts/sorttable.js"></script> ********> function replaceBrokenImages() { const defaultImage = 'http://ootp.biz/mlb/images/default_player_photo.png'; const images = document.getElementsByTagName('img'); for (let img of images) { // Add event listener instead of directly assigning to onerror property img.addEventListener('error', function() { console.log(`Image not found: ${this.src}`); this.src = defaultImage; // Set default image source }); // Check for cached images and force error check if (img.complete && img.naturalHeight === 0) { img.dispatchEvent(new Event('error')); // Trigger error event } } } window.onload = replaceBrokenImages; </script> </head> Last edited by andjbock; 06-12-2024 at 11:06 PM. |
![]() |
![]() |
![]() |
Bookmarks |
|
|