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

The Archive Base Latest Questions

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

I have a string \\u003c, which belongs to UTF-8 charset. I am unable to

  • 0

I have a string “\\u003c”, which belongs to UTF-8 charset. I am unable to decode it to unicode because of the presence of double backslashes. How do i get “\u003c” from “\\u003c”? I am using java.

I tried with,

myString.replace("\\\\", "\\");

but could not achieve what i wanted.

This is my code,

String myString = FileUtils.readFileToString(file);
String a = myString.replace("\\\\", "\\");
byte[] utf8 = a.getBytes();

// Convert from UTF-8 to Unicode
a = new String(utf8, "UTF-8");
System.out.println("Converted string is:"+a);

and content of the file is

\u003c

  • 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-05T16:10:02+00:00Added an answer on June 5, 2026 at 4:10 pm

    Not sure if you’re still looking for a solution to your problem (since you have an accepted answer) but I will still add my answer as a possible solution to the stated problem:

    String str = "\\u003c";
    Matcher m = Pattern.compile("(?i)\\\\u([\\da-f]{4})").matcher(str);
    if (m.find()) {
        String a = String.valueOf((char) Integer.parseInt(m.group(1), 16));
        System.out.printf("Unicode String is: [%s]%n", a);
    }
    

    OUTPUT:

    Unicode String is: [<]
    

    Here is online demo of the above code

    • 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 string as abvd.qweqw.sdfs.a=aqwrwewrwerrew . I need to parse this string and get
I have string in which it has Date of type- 'mm-dd-yyyy'; I have to
I have string which is of format: ;1=2011-10-23T16:16:53+0530;2=2011-10-23T16:16:53+0530;3=2011-10-23T16:16:53+0530;4=2011-10-23T16:16:53+0530; I have written following code to
I have string variable which represents the full path of some file, like: x
I have string which should be split on . (point) and (space). I have
I have string in the following format. Option1:Option2:Option3:Option4 I want to get these items
I have string Ärger,-Ökonom-i-Übermut-ẞ-ß and when I run IndexOf(--) I get a result of
I have string which contains every word separated by comma. I want to split
I have string (from a file): [\x22thanh\x22, [[\x22thanh\\u003Cb\\u003E nien\\u003C\\/b\\u003E\x22,0,[]], [\x22thanh\\u003Cb\\u003E ca\\u003C\\/b\\u003E\x22,0,[]], [\x22thanh\\u003Cb\\u003E nhan\\u003C\\/b\\u003E\x22,0,[]], [\x22thanh\\u003Cb\\u003E

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.