I'm integrating with the twitter API which describes that data should be "percent encoded". In C# I found that the method that matched Twitters docs was Uri.EscapeDataString. I'm trying to do the same thing in Dart and discovered that none of them methods on the Uri class behaved correctly, but someone pointed me at this package.
This seems to work great for all the characters I've tried, except numbers:
// Dart:
print(percent.encode("1".codeUnits)); // outputs %31
// C#:
Console.WriteLine(Uri.EscapeDataString("1")); // outputs 1
The C# version seems to match twitter definition of "percent encoding" but I'm struggling to find detailed docs on whether this is a standard and if so, which is correct. I'm raising it here in the hope that either a) it's a bug and can be fixed or b) there's another method I want that behaves as C# does/twitter expects.
I'm integrating with the twitter API which describes that data should be "percent encoded". In C# I found that the method that matched Twitters docs was
Uri.EscapeDataString. I'm trying to do the same thing in Dart and discovered that none of them methods on theUriclass behaved correctly, but someone pointed me at this package.This seems to work great for all the characters I've tried, except numbers:
The C# version seems to match twitter definition of "percent encoding" but I'm struggling to find detailed docs on whether this is a standard and if so, which is correct. I'm raising it here in the hope that either a) it's a bug and can be fixed or b) there's another method I want that behaves as C# does/twitter expects.