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 8648069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:13:46+00:00 2026-06-12T13:13:46+00:00

I have the following code: header(‘Content-type: text/html; charset=utf-8’); $str = ‘áá áá’; echo $str.\n;

  • 0

I have the following code:

header('Content-type: text/html; charset=utf-8');
$str = 'áá áá';
echo $str."\n";
echo mb_convert_case($str, MB_CASE_TITLE)."\n";
echo bin2hex($str)."\n";
echo bin2hex(mb_convert_case($str, MB_CASE_TITLE))."\n";

Using PHP 5.2.2, I get the following output:

áá áá
áá áá
c3a1c3a120c3a1c3a1
c3a1c3a120c3a1c3a1

Using PHP 5.4.3, I get this:

áá áá
á� á�
c3a1c3a120c3a1c3a1
c3a1e3a120c3a1e3a1

My expected output in both cases would have been:

áá áá
Áá Áá
c3a1c3a120c3a1c3a1
c381c3a120c381c3a1

So I have two questions:

  1. Why isn’t the á being converted to Á?
  2. Why is PHP 5.4 breaking my strings?
  • 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-12T13:13:48+00:00Added an answer on June 12, 2026 at 1:13 pm

    Either pass in $encoding to every call to mb_ functions, or set:

    mb_internal_encoding("UTF-8");
    

    to make sure PHP knows what encoding you’re working with. Otherwise the encoding comes from php.ini, or a default ISO-8859-1 if not included there either.

    So your 5.4 installation is defaulting to ISO-8859-1 and so lowercasing the lead byte of the UTF-8 sequence, breaking it. The same happens for me in 5.2, so maybe there’s something else about your 5.2 installation that’s different – maybe internal_encoding in the ini being set to something else without letters in those byte positions?

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

Sidebar

Related Questions

I have the following code <div class=framepage> <header> <script type=text/javascript> function getBaseUrl() { return
I have the following code header(Content-Description: File Transfer); header('Content-Type: audio/mp3'); header(Content-Disposition: attachment; filename= .
I have a script that generates a csv file using the following code: header('Content-type:
I have following code: div.accountPage div.acct-form.login div.acct-header Log-in form.loginForm.login input(id=username, type=text, name=User, placeholder=Username, value=)
I have following PHP code $filename = 'a56.flv'; $file = C:/xampp/htdocs/site/flv/a56.flv; header(Content-Type: application/force-download); header('Content-Type:
I have the following code: <div id=header> <h1>HEADER TEXT</h1> <div id=members> <form action= method=post>
I have the following jQuery code: $(body.page-calendar-practices-2012-05 #content-header h1#title) which works fine. I can
I have the following jquery code: $(document).ready(function() { $(body[class*=page-calendar-practices] #content-header h1#title).after(<div id='athletics_practice-schedule'><div id='inner-title'><a href='www.example.com'
I have a header.html which start with session_start();. Then the following code, $_SESSION['cart'][$sw_id] is
I have following code: <style> .header { height:20px; width:100px; } .content { height:100px; width:100px;

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.