-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Neil Schemenauer wrote: | On Thu, May 19, 2005 at 01:55:04AM +0200, Damjan wrote: | |>I've made a very simple loginform function that uses Quixote-2.0 |>forms, but I've encountered a problem when a cyrillic username is |>POST-ed. | | | Your form may be simple but using international characters with web | forms definitely is not. :-( | | Here's a description of some of the horrors you can expect: | | http://ppewww.ph.gla.ac.uk/~flavell/charset/form-i18n.html | | |>The problem is that by default the browser will send the username as |>HTML entites (for ex. дамјан). |>That's because by default the Content-Type header specifies |>charset=iso-8859-1 and the browser can't send cyrillic characters in |>iso-8859-1. | | | I think the best thing for you is to set the content type of the | pages you are generating. Use UTF-8, if possible. An easy way is | to just set HTTPResponse.DEFAULT_CHARSET to 'utf-8'. | | You will also need to set HTTPRequest.DEFAULT_CHARSET. That's a | hack because the browser should really explictly providing the | charset. You probably need to assume that the browser sends data in | the same charset as the pages you sent it.
Ideally, yes, but I'm not sure that it's safe to assume this. The last time this topic came up I did some tests with IE and Mozilla and if I remember correctly, the only reliable way to know the character set coming from the browser is to explicitly set "accept-charset" on the form element. All versions of Mozilla and IE that I tested understood and "did the right thing" with extended text input. Otherwise, it's kind of a crapshoot what the browser will return and depends on a lot of things, including the charset of the page, the local charset, the browser and the operating system.
- -- Shahms E. King <[EMAIL PROTECTED]> Multnomah ESD
Public Key: http://shahms.mesd.k12.or.us/~sking/shahms.asc Fingerprint: 1612 054B CE92 8770 F1EA AB1B FEAB 3636 45B2 D75B -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iD8DBQFCjKyk/qs2NkWy11sRApnfAKDCExJREBNYhLUB437tDIq85CQO9wCeJxVD DJWMa7rz+2uHsaiE6iyL5SA= =2V5M -----END PGP SIGNATURE----- _______________________________________________ Quixote-users mailing list Quixote-users@mems-exchange.org http://mail.mems-exchange.org/mailman/listinfo/quixote-users