Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Jan 2011
    Posts
    51
    Thanks
    18
    Thanked 0 Times in 0 Posts

    UTF-8 Encoding Issues

    I have a PHP calendar script that I'm working on encoding in UTF-8. I put in special characters to test it out and they showed up right in the database, and in the update page for the script. However, in the actual calendar page, they're displaying properly. The only difference I'm finding between the two pages is that the page where the characters are NOT working, the calendar is being loaded into an iframe. Would that mess up the UTF-8 encoding?

    I put the below into the page being loaded into the iframe and in the page with the iframe code in it.

    Code:
    <meta http-equiv="Content-type" value="text/html; charset=UTF-8" />

  • #2
    Senior Coder
    Join Date
    Sep 2010
    Posts
    1,912
    Thanks
    15
    Thanked 227 Times in 227 Posts
    My suggestion would be, don't use an I-frame, use a modal window instead. A modal window is part of the original page.

  • #3
    New Coder
    Join Date
    Jan 2011
    Posts
    51
    Thanks
    18
    Thanked 0 Times in 0 Posts
    Hmmm, I've never heard of this before. My only thing is that an IFrame is ideal because I have this script available on a website for others to use. SO I give an iframe code for them to put in the page that they want to display the calendar in and the iframe loads the page with the calendar in it. Can I do something like this with a modal window?

  • #4
    Senior Coder
    Join Date
    Sep 2010
    Posts
    1,912
    Thanks
    15
    Thanked 227 Times in 227 Posts
    Another possibility is to make the calendar as an .svg file, SVG is a version of XML, which handles Unicode very well. the SVG could be embeded or perhaps put in the I-frame. You can also convert the .svg to a .png or other image file.

  • #5
    New Coder
    Join Date
    Jan 2011
    Posts
    51
    Thanks
    18
    Thanked 0 Times in 0 Posts
    Eh, it's not image based. It's PHP generated. Other options I thought of was maybe having someone put in a php include statement instead and change the page to a .php. But I'm hoping for something simpler, like pasting in an iframe code and not having to change the page extension.

  • #6
    Senior Coder
    Join Date
    Sep 2010
    Posts
    1,912
    Thanks
    15
    Thanked 227 Times in 227 Posts
    Quote Originally Posted by hunter1611 View Post
    Eh, it's not image based. It's PHP generated. Other options I thought of was maybe having someone put in a php include statement instead and change the page to a .php. But I'm hoping for something simpler, like pasting in an iframe code and not having to change the page extension.
    You can use PHP to generate .svg files, and they are XML so they handle unicode very well thank you. I've written PHP code that makes an .svg and lets you save as an image, and they can be unicode..

  • #7
    New Coder
    Join Date
    Jan 2011
    Posts
    51
    Thanks
    18
    Thanked 0 Times in 0 Posts
    Huh. That's interesting. At this point, the calendar gets the current month and loads the days based on that, and then all the other months around it. (You can navigate from month to month). And then the events are loaded into the calendar through a MySQL database. I can still do all this with an SVG? I'm googling a bit and it looks...complicated. How easy is this going to be to implement you think?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •