Well, display as specified by encoding="..." - it covers the most general case. Plus there's the possibility to change the encoding manually (haven't tried the latest builds yet..) Ideally, the best you can do is to check whether the content really has that encoding (somehow) and if it doesn't, bring up a warning message like "Encoding attribute says that it's utf-8 but it looks like it's different. Would you like to choose the encoding or open as utf-8 anyway?"
-----Original Message----- From: "Maxim Shafirov" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Date: Thu, 18 Jul 2002 14:21:17 +0400 Subject: [Eap-features] Re: Improvement: make encoding detection intelligent, not based on assumptions > > Regarding using XML's header encoding I wonder what to do if someone types > other encoding in editor there? > > -- > > Best regards, > Maxim Shafirov > JetBrains, Inc / IntelliJ Software > http://www.intellij.com > "Develop with pleasure!" > > > "Walter Mundt" <[EMAIL PROTECTED]> wrote in message > ah64f2$j69$[EMAIL PROTECTED]">news:ah64f2$j69$[EMAIL PROTECTED]... > > > Any ideas how to determine an encoding by file content? > > At least, for XML files, IDEA should check for the encoding setting, and > > honor that if it exists. If not, try to detect. Based on the discussion > > here, I would suggest: > > > > 1. Check for XML encoding attribute. If present, use that. > > 2. Check whether the file is in UTF format, according to other messages > > here. > > 3. Try anything you think of that I haven't. > > 4. If the selected charset in IDEA is not UTF (since we know the file > isn't > > in UTF anyway), use that. > > 5. If the selected charset IS UTF, use the system default 8-bit charset. > > > > Does that sound like a reasonable detection scheme? > > > > -Walter Mundt > > > > > > > > > _______________________________________________ > Eap-features mailing list > [EMAIL PROTECTED] > http://lists.jetbrains.com/mailman/listinfo/eap-features > ------------------------------------ Mail.Ru - ������, ��������, �������! ------------------------------------ _______________________________________________ Eap-features mailing list [EMAIL PROTECTED] http://lists.jetbrains.com/mailman/listinfo/eap-features
