How do you encode Chinese characters in a url?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How do you encode Chinese characters in a url?

Terry Raymond

I have Chinese characters that are represented by TwoByteString. When I

put them in a URL and later attempt to decode the URL, the Chinese character string

does not get reconstructed.  For example;

| url |

url := Net.HttpURL

                host: 'host'

                pathString: 'http://host/seg/中文?ok=8'.

url pathString

                '/http://host/seg/%4E2D%6587?ok=8'

 

Terry

 

===========================================================

Terry Raymond

Crafted Smalltalk

80 Lazywood Ln.

Tiverton, RI  02878

(401) 624-4517      [hidden email]

===========================================================

 


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: How do you encode Chinese characters in a url?

Kogan, Tamara

Try to use URLEncoder to encode path tokens:

URLEncoder encode: '中文?ok=8' -> '%E4%B8%AD%E6%96%87%3Fok%3D8'

URLEncoder decode:  '%E4%B8%AD%E6%96%87%3Fok%3D8' -> '中文?ok=8'

 

Tamara Kogan

Smalltalk Development

Cincom Systems

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Terry Raymond
Sent: Monday, October 08, 2012 10:43 AM
To: VWNC
Subject: [vwnc] How do you encode Chinese characters in a url?

 

I have Chinese characters that are represented b! y TwoByteString. When I

put them in a URL and later attempt to decode the URL, the Chinese character string

does not get reconstructed.  For example;

| url |

url := Net.HttpURL

                host: 'host'

                pathString: 'http://host/seg/中文?ok=8'.

url pathString

                '/http://host/seg/%4E2D%6587?ok=8'

 

Terry

 

=========================! ==================================

Terry Raymond

Crafted Smalltalk

80 Lazywood Ln.

Tiverton, RI  02878

(401) 624-4517      [hidden email]

===========================================================

 


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: How do you encode Chinese characters in a url?

Terry Raymond

Tamara

 

Thanks, that did it.

 

Terry

 

===========================================================

Terry Raymond

Crafted Smalltalk

80 Lazywood Ln.

Tiverton, RI  02878

(401) 624-4517      [hidden email]

===========================================================

 

From: Kogan, Tamara [mailto:[hidden email]]
Sent: Monday, October 08, 2012 12:14 PM
To: Terry Raymond; VWNC
Subject: RE: [vwnc] How do you encode Chinese characters in a url?

 

Try to use URLEncoder to encode path tokens:

URLEncoder encode: '中文?ok=8' -> '%E4%B8%AD%E6%96%87%3Fok%3D8'

URLEncoder decode:  '%E4%B8%AD%E6%96%87%3Fok%3D8' -> '中文?ok=8'

 

Tamara Kogan

Smalltalk Development

Cincom Systems

 

From: [hidden email] [hidden email] On Behalf Of Terry Raymond
Sent: Monday, October 08, 2012 10:43 AM
To: VWNC
Subject: [vwnc] How do you encode Chinese characters in a url?

 

I have Chinese characters that are represented by TwoByteString. When I

put them in a URL and later attempt to decode the URL, the Chinese character string

does not get reconstructed.  For example;

| url |

url := Net.HttpURL

                host: 'host'

                pathString: 'http://host/seg/中文?ok=8'.

url pathString

                '/http://host/seg/%4E2D%6587?ok=8'

 

Terry

 

===========================================================

Terry Raymond

Crafted Smalltalk

80 Lazywood Ln.

Tiverton, RI  02878

(401) 624-4517      [hidden email]

===========================================================

 


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: How do you encode Chinese characters in a url?

Terry Raymond
In reply to this post by Kogan, Tamara

Why is it that #host:pathString: does not use the URLEncoder to encode the path?

 

Terry

 

===========================================================

Terry Raymond

Crafted Smalltalk

80 Lazywood Ln.

Tiverton, RI  02878

(401) 624-4517      [hidden email]

===========================================================

 

From: Kogan, Tamara [mailto:[hidden email]]
Sent: Monday, October 08, 2012 12:14 PM
To: Terry Raymond; VWNC
Subject: RE: [vwnc] How do you encode Chinese characters in a url?

 

Try to use URLEncoder to encode path tokens:

URLEncoder encode: '中文?ok=8' -> '%E4%B8%AD%E6%96%87%3Fok%3D8'

URLEncoder decode:  '%E4%B8%AD%E6%96%87%3Fok%3D8' -> '中文?ok=8'

 

Tamara Kogan

Smalltalk Development

Cincom Systems

 

From: [hidden email] [hidden email] On Behalf Of Terry Raymond
Sent: Monday, October 08, 2012 10:43 AM
To: VWNC
Subject: [vwnc] How do you encode Chinese characters in a url?

 

I have Chinese characters that are represented by TwoByteString. When I

put them in a URL and later attempt to decode the URL, the Chinese character string

does not get reconstructed.  For example;

| url |

url := Net.HttpURL

                host: 'host'

                pathString: 'http://host/seg/中文?ok=8'.

url pathString

                '/http://host/seg/%4E2D%6587?ok=8'

 

Terry

 

===========================================================

Terry Raymond

Crafted Smalltalk

80 Lazywood Ln.

Tiverton, RI  02878

(401) 624-4517      [hidden email]

===========================================================

 


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: How do you encode Chinese characters in a url?

Kogan, Tamara

There is  high priority AR to fix the URL encoding/decoding issues.  The AR will be considered for 7.11.

50261: "Move Wave encoding handling of URI-encode/decode to base URI"

 

Tamara Kogan

Smalltalk Development

Cincom Systems

 

From: Terry Raymond [mailto:[hidden email]]
Sent: Monday, October 08, 2012 1:18 PM
To: Kogan, Tamara; 'VWNC'
Subject: RE: [vwnc] How do you encode Chinese characters in a url?

 

Why is it that #host:pathString: does not use the URLEncoder to encode the path?

 

Terry

 

===========================================================

Terry Raymond

Crafted Smalltalk

80 Lazywood Ln.

Tiverton, RI  02878

(401) 624-4517      [hidden email]

===========================================================

 

From: Kogan, Tamara [hidden email]
Sent: Monday, October 08, 2012 12:14 PM
To: Terry Raymond; VWNC
Subject: RE: [vwnc] How do you encode Chinese characters in a url?

 

Try to use URLEncoder to encode path tokens:

URLEncoder encode: '� BCfJ8?ok=8' -> '%E4%B8%AD%E6% 96%87%3Fok%3D8'

URLEncoder decode:  '%E4%B8%AD%E6%96%87%3Fok%3D8' -> '中文?ok=8'

 

Tamara Kogan

Smalltalk Development

Cincom Systems

 

From: [hidden email] [hidden email] On Behalf Of Terry Raymond
Sent: Monday, October 08, 2012 10:43 AM
To: VWNC
Subject: [vwnc] How do you encode Chinese characters in a url?

 

I have Chinese characters that are represented by TwoByteString. When I

put them in a URL and later attempt to decode the URL, the Chinese character string

does not get reconstructed.  For example;

| url |

url := Net.HttpURL

       &nbs p;        host: 'host'

                pathString: 'http://host/seg/中文?ok=8'.

url pathString

                '/http://host/seg/%4E2D%6587?ok=8'

 

Terry

 

===========================================================

Terry Raymond

Crafted Smalltalk

80 Lazywood Ln.

Tiverton, RI  02878

(401) 624-4517      [hidden email]

===========================================================

 


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc