Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8069857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:12:01+00:00 2026-06-05T13:12:01+00:00

I have a problem with the char encoding in yii. If I create a

  • 0

I have a problem with the char encoding in yii.
If I create a new webapp:

 ./Yii-framework/framework/yiic webapp MyTest

Then go to /protected/views/layouts/main.php and change the footer to a text with an utf8 character, for example

<div id="footer">
        Cópyrîgth <br />
</div>

Refresh the page and everything is ok. Nice! 😉

And then I try to log in with an utf8 character in the username, for example ádmin, it crashes saying:

Error 500

htmlspecialchars(): Invalid multibyte sequence in argument

So I checked this article about unicode in yii

and then I went to /protected/config/main.php and added this line at the start:

header('Content-Type: text/html; charset=utf-8');

Retrying the same login again it works (doesn’t crash) but now the footer is broken and shows:

C�pyr�ght

I’ve tried other combinations like explained in the “Unicode in yii” article but none of them make both things work at the same time.

Any ideas for solving this problem?

Note: I can’t change to the php.ini file.

I also tried the AddDefaultCharset UTF-8 option in the .htaccess file and put it in the folder at the /MyTest/ is that the correct folder referred in the article as: your DocumentRoot ?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T13:12:03+00:00Added an answer on June 5, 2026 at 1:12 pm

    I’m not at all familiar with yii, but, if you want to paste literal unicode characters into a file, you need to make sure that your text editor saves the file using a unicode encoding, such as utf8. Try utf8, without a BOM.

    My experience is that text editors behave strange when you change the encoding setting and there’s already encoded characters in it. Just start over with a fresh file, change the encoding, then paste the characters in.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem in JS encoding and then decoding in the C# server.
I have problem creating new instance of excel 2007 using VBA (from Access 2002).
I have a problem with some symbols in UTF-8 encoding. I am reading the
I have problem with encoding data in Oracle database. I want to xor string
I have a problem with Perl and Encoding pragma. (I use utf-8 everywhere, in
I have problem with pointers. This is working fine - int main(void){ char *w;
I have some serious problem dealing with files in php with utf-8 encoding. I
I have problem with fancybox. I want to write a function that will run
i have problem with autorotate on iphone i set up in all classes -
I have problem with cakephp's Session->write method. If I set a value like $_SESSION['..']

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.