powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Oracle APEX [игнор отключен] [закрыт для гостей] / apex + mod_owa + apache 2.2 + ubuntu x32 проблемы с кодировкой
4 сообщений из 4, страница 1 из 1
apex + mod_owa + apache 2.2 + ubuntu x32 проблемы с кодировкой
    #38360623
smittyperm
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Добрый день. Никак не могу понять, где что забыл:
Имеется: ubuntu 13.04 x32, oracle 10.2.0.1.0, apex 4.2.1.00.08, apache 2.2.2.
...
Рейтинг: 0 / 0
apex + mod_owa + apache 2.2 + ubuntu x32 проблемы с кодировкой
    #38360630
Gustly
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
smittyperm,

А где описание проблемы?
...
Рейтинг: 0 / 0
apex + mod_owa + apache 2.2 + ubuntu x32 проблемы с кодировкой
    #38360661
smittyperm
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Прошу прощения (ctrl+enter по привычке).
Кодировка oracle xe:
Код: plsql
1.
2.
NLS_CHARACTERSET
AL32UTF8


Настроил все следующим образом:
В скрипт запуска apache добавил:
Код: plsql
1.
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8


В виртуальный хост Location записал с такойже кодировкой:
Код: plsql
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
<Location /apex>
AllowOverride None
Options	 None
SetHandler	 owa_handler
OwaUserid	 apex_public_user/123789456
OwaNLS	 "AMERICAN_AMERICA.AL32UTF8"
OwaDiag	 COMMAND ARGS CGIENV POOL SQL MEMORY
OwaLog	 "/var/log/apache2/owa.log"
OwaPool	 20
OwaStart	 "doc_pkg.homepage" 
OwaDocProc "doc_pkg.readfile"
OwaDocPath	 docs
OwaDocTable	WWV_FLOW_FILE_OBJECTS$ BLOB_CONTENT
OwaUploadMax 100M
OwaCharset "UTF8"
order	 deny,allow
allow	 from all 
</Location>



Проблема в том что при отображении любой информации из БД (например русские символы в select list, полученные запросом), выдается:
Error during rendering of page item P2_RESORA-06502: PL/SQL: numeric or value error: character string buffer too small

Technical Info (only visible for developers)
is_internal_error: true
apex_error_code: WWV_FLOW_FORM.UNHANDLED_ERROR
ora_sqlcode: -6502
ora_sqlerrm: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
component.type: APEX_APPLICATION_PAGE_ITEMS
component.id: 2658219846444118
component.name: P2_RES
error_backtrace:
ORA-06512: at "SYS.HTP", line 1529
ORA-06512: at "SYS.HTP", line 1714
ORA-06512: at "APEX_040200.WWV_FLOW_PLUGIN_UTIL", line 433
ORA-06512: at "APEX_040200.WWV_FLOW_NATIVE_ITEM", line 1669
ORA-06512: at "APEX_040200.WWV_FLOW_NATIVE_ITEM", line 1809
ORA-06512: at "APEX_040200.WWV_FLOW_NATIVE_ITEM", line 4241
ORA-06512: at "APEX_040200.WWV_FLOW_PLUGIN", line 1251
ORA-06512: at "APEX_040200.WWV_FLOW_FORMS", line 977
ORA-06512: at "APEX_040200.WWV_FLOW_FORMS", line 1406

Опытным путем пришел к тому что если в виртуальном хосте апача написать кодировку:
Код: plsql
1.
OwaCharset "iso-8859-1"


То почти все заработает, кроме любого символа кирилицы при использовании htp.p.
В этом случае будет так:
Error during rendering of region "canvas".ORA-06502: PL/SQL: numeric or value error: character string buffer too small ORA-06512: at "SYS.HTP", line 1536 ORA-06512: at "SYS.HTP", line 1714 ORA-06512: at line 8 ORA-06502: PL/SQL: numeric or value error: character string buffer too small

Technical Info (only visible for developers)
is_internal_error: true
apex_error_code: APEX.REGION.UNHANDLED_ERROR
ora_sqlcode: -6502
ora_sqlerrm: ORA-06502: PL/SQL: numeric or value error: character string buffer too small ORA-06512: at "SYS.HTP", line 1536 ORA-06512: at "SYS.HTP", line 1714 ORA-06512: at line 8 ORA-06502: PL/SQL: numeric or value error: character string buffer too small
component.type: APEX_APPLICATION_PAGE_REGIONS
component.id: 2659007399469462
component.name: canvas
error_backtrace:
ORA-06512: at "SYS.HTP", line 1536
ORA-06512: at "SYS.HTP", line 1714
ORA-06512: at line 8
ORA-06512: at "SYS.DBMS_SYS_SQL", line 1202
ORA-06512: at "SYS.WWV_DBMS_SQL", line 973
ORA-06512: at "SYS.HTP", line 1536
ORA-06512: at "SYS.HTP", line 1714
ORA-06512: at line 8
ORA-06512: at "APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS", line 4612
ORA-06512: at "APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS", line 3219

Через стандартный http сервер oraclexe все работает нормально.
Что я делаю не так?
...
Рейтинг: 0 / 0
apex + mod_owa + apache 2.2 + ubuntu x32 проблемы с кодировкой
    #38362495
smittyperm
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Решение.
Сам нашел ответ здесь:
https://oss.oracle.com/projects/mod_owa/dist/documentation/modowa.htm OWA gives PL/SQL errors with multi-byte databases

This is due to an incorrect implementation of the page buffer in the HTF package (pubht.sql and privht.sql). The problem arises because SQL and PL/SQL data buffers measure their maximum lengths in bytes, whereas all string operations, e.g. SUBSTR, LENGTH, etc., measure in characters. As a result, the HTBUF_LEN limit of 255 is not enforced properly with multi-byte character sets. I am trying to get Oracle to fix this by using the byte-based equivalents SUBSTRB, LENGTHB, etc. in the underlying code. Meanwhile, the simple fix is to use the OwaCharsize directive to reduce this limit based on your worst-case character size. For most multi-byte character sets, this will be 2 bytes per character, so the limit would be 127. For old UTF8 Unicode, it's 3 bytes per character, meaning the limit should be 85. For the newer AL32UTF8 Unicode, it's 4 bytes per character, and the limit should be 63. For a small number of Asian character sets it's also 4 bytes per character (you can recognize them because they will have a "32" in the Oracle character set name, e.g. "ZHT32EUC"), and the limit should be 63. OwaCharsize can be used to set the number of bytes per character N, which will cause mod_owa to force the buffer length down to floor(255/N). If in doubt, setting OwaCharsize to 4 is generally safest, although it may reduce performance.


Таким образом, если у вас бд с кодировкой AL32UTF8, используйте, например:
Код: plsql
1.
2.
OwaCharset "UTF-8"
OwaCharsize 4


Обратите внимание на дефис в UTF-8.
...
Рейтинг: 0 / 0
4 сообщений из 4, страница 1 из 1
Форумы / Oracle APEX [игнор отключен] [закрыт для гостей] / apex + mod_owa + apache 2.2 + ubuntu x32 проблемы с кодировкой
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]