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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:40:37+00:00 2026-06-17T08:40:37+00:00

I have to convert a UTF-8 string to non UTF-8 string, I want to

  • 0

I have to convert a UTF-8 string to non UTF-8 string, I want to replace:

Ậ,Ẫ,Ẩ,Ầ,Ấ,Â,Ặ,Ẵ,Ẳ,Ằ,Ắ,Ă,Ạ,Ã,Ả,À,Á to A,

Ự,Ữ,Ử,Ừ,Ứ,Ư,Ụ,Ũ,Ủ,Ù,Ú to U,

Ợ,Ỡ,Ở,Ờ,Ớ,Ơ,Ộ,Ỗ,Ổ,Ồ,Ố,Ô,Ọ,Õ,Ỏ,Ò,Ó to O… and much more with same case

By php preg_replace() ?

May I use ?:

$string = preg_replace('/Ậ,Ẫ,Ẩ,Ầ,Ấ,Â,Ặ,Ẵ,Ẳ,Ằ,Ắ,Ă,Ạ,Ã,Ả,À,Á/', 'A', $string);
$string = preg_replace('/Ợ,Ỡ,Ở,Ờ,Ớ,Ơ,Ộ,Ỗ,Ổ,Ồ,Ố,Ô,Ọ,Õ,Ỏ,Ò,Ó/', 'O', $string);
$string = preg_replace('/Ự,Ữ,Ử,Ừ,Ứ,Ư,Ụ,Ũ,Ủ,Ù,Ú/', 'U', $string);
  • 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-17T08:40:38+00:00Added an answer on June 17, 2026 at 8:40 am

    You can, if you remove the ,, place everything inside a character class, and add the /u modifier if the input string is UTF-8. Example:

    preg_replace('/[ỰỮỬỪỨƯỤŨỦÙÚ]/u', 'U', $string);
    

    You can also use str_replace():

    str_replace(array('Ự', 'Ữ', ...), 'U', $string);
    

    or strtr():

    strtr($string, 'ỰỮỬ', 'UUU');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have string that displays UTF-8 encoded characters, and I want to convert it
I have UTF-8 encoded NSData from windows server and I want to convert it
I have a C++ code snippet that uses MultiByteToWideChar to convert UTF-8 string to
I just have the string \u0130smail and I want to convert it to İsmail
I have a working algorithm to convert a UTF-8 string to a UTF-32 string,
A system I'm building needs to convert non-negative Ruby integers into shortest-possible UTF-8 string
If I have a UTF-8 std::string how do I convert it to a UTF-16
I'm trying to convert UTF-8 to base64 string. Example: I have abcdef== in UTF-8
I have to convert a string into binary using UTF-8, but i am unable
I have to convert an incoming String field into a BigDecimal field that would

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.