Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2020-11-18
11:06 • Ticket [9575f0dec8] http::CharsetToEncoding: map GB18030 to GB2312 status st... artifact: d9e722d1ed user: oehhar
11:05 • New ticket [367bfdcf89] Add GB18030 encoding. artifact: 2ddb94e1a3 user: oehhar
10:41 • Ticket [9575f0dec8] http::CharsetToEncoding: map GB18030 to GB2312 status st... artifact: 64de687635 user: jan.nijtmans
09:45 • Ticket [9575f0dec8]: 6 changes artifact: c74023472b user: oehhar
09:18 • Ticket [9575f0dec8]: 5 changes artifact: 31fe70a57f user: jan.nijtmans
08:10 • Closed ticket [9575f0dec8]. artifact: 7b1166b2d4 user: oehhar
2020-11-02
10:07 • New ticket [9575f0dec8]. artifact: 19c38d5b5b user: oehhar

http::CharsetToEncoding: map GB18030 to GB2312

Closed / Rejected9575f0dec854ee0a7fb6e7edc9e351b9f3ae194fCreated 6 years agoUpdated 6 years ago
Descriptionwiki2020-11-02 10:07:35
TCL does not feature a GB18030 encoding. Nevertheless, this encoding is compatible on the 16 bit unicode plane to GB2312. (See Wikipedia: https://en.wikipedia.org/wiki/GB_18030).

The 16 bit unicode plane of GB18030 is mandatory for all software products in China, so support may be important.

The proposal of this ticket is to map GB18030 to GB2312 in http::CharsetToEncoding.

If GB18030 is used as a specified charset in a http transaction, at least 16 bit codes are correctly decoded. Any other code is anyway not representable by TCL8.6.10.

Example of a http reply header:

Content-Type: text;charset=GB18030

Just an idea. I am not deeply in this subject but this may help some people from this region.

Thank you, Harald

Referenced by1
oehharwiki2020-11-18 08:10:28

After thinking on it, it does not feel like a good idea. It is incomplete and any interested application may implement that on its own.

Thank you, Harald

jan.nijtmanswiki2020-11-18 09:18:42

How about adding a real GB18030 encoding to 8.7?

oehharwiki2020-11-18 09:45:44

Yes of cause, preferable. I asked about that on clt. The answer was, that that is not possible due to the required 32 bit unicode.

Thank you, Harald

jan.nijtmanswiki2020-11-18 10:41:24

Well, how about TIP #389 then? In Tcl 8.7 we can use characters > U+FFFF by storing them as surrogate pairs. So a single (multibyte) character could result in 2 surrogates. That's not possible now, with the current "*.enc" files.

Currently there are 4 types of "*.enc" files: Single-byte ("S"), double-byte("D") escape-driven("E") and multi-byte("M"). So, we would need a 5th type (e.g. "U"), I don't see why that wouldn't be possible.

For Tcl 9, we have 32-bit characters, but still we would need the same additional format: we cannot do it with the existing "*.enc" files.

oehharwiki2020-11-18 11:06:28

Thank you, Jan, for the answer. This would be great to have GB18030 as encoding.

It feels like a certain way to go.

A new RFE [367bfdcf8] is opened with your initial information included.

Thank you, Harald

Log in (anonymous is fine) to add a comment.