Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Siempre mayúsculas en URL encoding.
  • Loading branch information
MarioFinale committed Apr 7, 2018
1 parent 1b70a74 commit bb83d25
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CommFunctions.vb
Expand Up @@ -224,6 +224,7 @@ NotInheritable Class CommFunctions
Public Shared Function GetTitlesFromQueryText(ByVal sourcestring As String) As String()
Return TextInBetween(sourcestring, ",""title"":""", """,")
End Function

''' <summary>
''' Normaliza el texto ASCII con códigos unicodes escapados con el formato \\u(número)
''' </summary>
Expand All @@ -239,14 +240,18 @@ NotInheritable Class CommFunctions
temptext = temptext.Replace("\\t", "\t")
Return temptext
End Function

''' <summary>
''' Codifica una cadena de texto en URLENCODE.
''' </summary>
''' <param name="text">Texto a codificar.</param>
''' <returns></returns>
Public Shared Function UrlWebEncode(ByVal text As String) As String
Return Net.WebUtility.UrlEncode(text)
Dim PreTreatedText As String = Net.WebUtility.UrlEncode(text)
Dim TreatedText As String = Regex.Replace(PreTreatedText, "%\w{2}", Function(x) x.Value.ToUpper)
Return TreatedText
End Function

''' <summary>
''' Decodifica una cadena de texto en URLENCODE.
''' </summary>
Expand Down

0 comments on commit bb83d25

Please sign in to comment.