471,072 Members | 1,381 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,072 software developers and data experts.

URL Encoding German Chars problem. help please

Hi All,
I''m using c# in asp.net and I tried to encode some upper part of ASCII chars, eg.
The desired result should be: %E1
But when I use HttpUtility.UrlEncode(""), the output result is: %c3%a1
I tried ISO 8859-1 and utf-8, neither works.
anybody can help me?
Or other way to do it, javascript escape?no experice with that
thanks for any help

Feng

-----------------------------
This message is posted by http://Asp.ForumsZone.com

Nov 17 '05 #1
2 2424


feng zhu wrote:
I''m using c# in asp.net and I tried to encode some upper part of ASCII chars, eg.
The desired result should be: %E1
But when I use HttpUtility.UrlEncode(""), the output result is: %c3%a1
I tried ISO 8859-1 and utf-8, neither works.
anybody can help me?


I didn't know that is a German character but I think what you want is
to encode from ISO-8859-1

using System;
using System.Web;

public class Test20031029 {
public static void Main (string[] args) {
string s = "";
Console.WriteLine("{0} URLencoded: {1}", s,
HttpUtility.UrlEncode(s, System.Text.Encoding.GetEncoding("ISO-8859-1")));
}
}
--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 17 '05 #2
"feng wrote:
Hi All,
I''m using c# in asp.net and I tried to encode some upper part of
ASCII chars, eg. The desired result should be: %E1
But when I use HttpUtility.UrlEncode(""), the output result is:
%c3%a1 I tried ISO 8859-1 and utf-8, neither works.
anybody can help me?


isn't exactly a German character, and %c3%a1 is the correct URL
encoding for that character's UTF-8 representation.

Cheers,
--
Joerg Jooss
jo*********@gmx.net
Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Konrad Den Ende | last post: by
1 post views Thread by klappnase | last post: by
7 posts views Thread by polarz | last post: by
12 posts views Thread by Tamir Khason | last post: by
4 posts views Thread by Jaroslav Jakes | last post: by
23 posts views Thread by Allan Ebdrup | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.