invalid byte 2 of 2 byte utf 8 sequence что значит
Invalid byte 2 of 2-byte UTF-8 sequence.
Troubleshooting
Problem
While generating the OpenPages Framework, the process fails with the error «Invalid byte 2 of 2-byte UTF-8 sequence».
Cause
One cause of this error has been due to invalid characters in the OpenPages Data Source configuration.
During an attempted framework generation, Cognos will parse the OpenPages Data Source configuration. If illegal characters are encountered during this process, this error can be seen.
Resolving The Problem
1. Log into the Cognos Configuration portal using the OpenPagesAdministrator account:
2. Click «Launch > IBM Cognos Administration.
3. On the Configuration tab, click Data Source Connections.
4. Click More next to OpenPages DataSource.
5. Click Set properties.
6. Select the Connection tab.
7. In the entry for «Open session commands», click «Edit».
8. Copy this entire text into a plain text editor and remove any white spaces and special characters.
9. Delete the existing text in Cognos, paste the clean plain ASCII.
10. There should be no space or newline after the last character in the XML.
11. Save the entry and re-attempt the framework.
Unless you have a customized datasource, the exact text that is required here can be obtained from the OpenPages installation manual. For OpenPages versions 7.0 and 7.1, the exact text is below as a reference only. Note that this may be different for other versions.
SAXException: Invalid byte 2 of 2-byte UTF-8 sequence
I am trying to parse an XML file using SAX parser which contains Swedish character «��� ��� �».
I have used the UTF-8 encoding in the XML document.
But the parser gives me the exception:
If I use the encoding iso-8859-1, it works fine.
Can anybody help me in understanding why it doesn’t work with UTF-8 encoding.
Is there any way I can parse my XML, using SAX parser with UTF-8 encoding.
Thanks!
[ January 25, 2008: Message edited by: P Lavti ]


Originally posted by P Lavti:
I have used the UTF-8 encoding in the XML document.
The file is created at run time. How can I create a file in java which understand UTF-8 chars.
One more thing, If I change the encoding to iso-8859-1 it works fine.


For my testing I was creating the file in windows.. instead of creating at run time..
Can there be any wrong in the given text for UTF-8 conversion or that the document was not rightly encoded with UTF-8?
If the document was not created with UTF-8 why does it errors only at a particular line parsing after nerly 10000 lines of the doc?
Invalid byte 2 of 2 byte utf 8 sequence что значит
Профиль
Группа: Участник
Сообщений: 9
Регистрация: 16.1.2008
Репутация: нет
Всего: нет
| Код |
65799836 VTB\HN11 ChangeNewDocumentStatus |
| Код |
| DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); doc = db.parse(uri); |
| Цитата |
| Sorry, an error occurred: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 2-byte UTF-8 sequence. |
не нравица мне эти двоеточия в файле.
не знаю что они ваще означают.
Шустрый
Профиль
Группа: Участник
Сообщений: 125
Регистрация: 11.1.2008
Где: Кыев, Украина
Репутация: нет
Всего: нет
Емельянова Валентина Сергеевна
Попробуй заменить кириллицу на буржуйницу :о) Ради теста :о)
Профиль
Группа: Участник
Сообщений: 9
Регистрация: 16.1.2008
Репутация: нет
Всего: нет
Опытный
Профиль
Группа: Участник
Сообщений: 559
Регистрация: 1.8.2002
Где: Обнинск
Репутация: 1
Всего: 3
Шустрый
Профиль
Группа: Участник
Сообщений: 125
Регистрация: 11.1.2008
Где: Кыев, Украина
Репутация: нет
Всего: нет
| Цитата(dbocharov @ 17.1.2008, 16:00) |
| слушай помогло ))) как же быть если у меня ФИО всех сотрудников на русском языке? |
У тебя ФИО сотрудников не в UTF-8, а типа в cp-1251.
Если ты пишешь, что у тебя стринги в XML файле находятся в UTF-8, то они и должны у тя быть в UTF-8
Leprechaun Software Developer
Профиль
Группа: Модератор
Сообщений: 15682
Регистрация: 24.3.2004
Репутация: 206
Всего: 534
Профиль
Группа: Участник
Сообщений: 9
Регистрация: 16.1.2008
Репутация: нет
Всего: нет
| Цитата |
| Проверь кодировку файла или прикрепи пример файла к сообщению. |
я извиняюсь. но как проверить )
Leprechaun Software Developer
Профиль
Группа: Модератор
Сообщений: 15682
Регистрация: 24.3.2004
Репутация: 206
Всего: 534
Профиль
Группа: Участник
Сообщений: 9
Регистрация: 16.1.2008
Репутация: нет
Всего: нет
не пожожешь как DOM на кодировку настроить или еще что то?
Autonomous R&D
Профиль
Группа: Участник
Сообщений: 686
Регистрация: 8.2.2006
Где: Екатеринбург
Репутация: 33
Всего: 81
Leprechaun Software Developer
Профиль
Группа: Модератор
Сообщений: 15682
Регистрация: 24.3.2004
Репутация: 206
Всего: 534
В принципе если ты знаешь кодировку заранее, то можно при парсинге DocumentBuilder подсовывать Reader который бы читал из файла в нужной кодировке.
Добавлено через 19 секунд
Но лучше все же исправить пролог.



























