MUHAMMAD SHAHID RAFI C P
MUHAMMAD SHAHID RAFI C P

Reputation: 1239

How to convert utf8 to text in dart

I want to convert special character utf8 value to it's text.

For example, if input is %20, the output will be whitespace if input is %23, the output will be #

Upvotes: 0

Views: 752

Answers (2)

void main() {
  var raw = 'Hello%20Bebop%23yahoo';
  var parsed = Uri.decodeComponent(raw);
  print(parsed);
}

Result:

Hello Bebop#yahoo

Upvotes: 1

Dr_Smu
Dr_Smu

Reputation: 3

Looks like you converting to an ASCCI like encoding. What function you are using for that result? Try finding the encoding table to your %20 and %23 output, so you will see where you heading at the moment.

Upvotes: 0

Related Questions