This is an automated email from the ASF dual-hosted git repository.
aldettinger pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/main by this push:
new 730e87dd42 xml-io: document the possibility to add all charsets in
native mode #4572
730e87dd42 is described below
commit 730e87dd42192d8028546bf4c029410122a3ede7
Author: aldettinger <[email protected]>
AuthorDate: Tue Feb 14 18:19:52 2023 +0100
xml-io: document the possibility to add all charsets in native mode #4572
---
.../pages/reference/extensions/xml-io-dsl.adoc | 10 +++++++
.../runtime/src/main/doc/configuration.adoc | 4 +++
.../src/main/resources/application.properties | 3 +-
.../resources/routes/my-routes-iso_8859_15.xml | 34 ++++++++++++++++++++++
.../camel/quarkus/main/CoreMainXmlIoTest.java | 11 +++++++
5 files changed, 61 insertions(+), 1 deletion(-)
diff --git a/docs/modules/ROOT/pages/reference/extensions/xml-io-dsl.adoc
b/docs/modules/ROOT/pages/reference/extensions/xml-io-dsl.adoc
index 484d27f7cb..0ae46ec85f 100644
--- a/docs/modules/ROOT/pages/reference/extensions/xml-io-dsl.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/xml-io-dsl.adoc
@@ -43,3 +43,13 @@ Or add the coordinates to your existing project:
ifeval::[{doc-show-user-guide-link} == true]
Check the xref:user-guide/index.adoc[User guide] for more information about
writing Camel Quarkus applications.
endif::[]
+
+[id="extensions-xml-io-dsl-additional-camel-quarkus-configuration"]
+== Additional Camel Quarkus configuration
+
+[id="extensions-xml-io-dsl-configuration-xml-file-encodings"]
+=== XML file encodings
+
+By default, some XML file encodings may not work out of the box in native mode.
+Please, check the xref:user-guide/native-mode.adoc#charsets[Character
encodings section] to learn how to fix.
+
diff --git a/extensions-core/xml-io-dsl/runtime/src/main/doc/configuration.adoc
b/extensions-core/xml-io-dsl/runtime/src/main/doc/configuration.adoc
new file mode 100644
index 0000000000..4778ce69c8
--- /dev/null
+++ b/extensions-core/xml-io-dsl/runtime/src/main/doc/configuration.adoc
@@ -0,0 +1,4 @@
+=== XML file encodings
+
+By default, some XML file encodings may not work out of the box in native mode.
+Please, check the xref:user-guide/native-mode.adoc#charsets[Character
encodings section] to learn how to fix.
\ No newline at end of file
diff --git
a/integration-tests/main-xml-io/src/main/resources/application.properties
b/integration-tests/main-xml-io/src/main/resources/application.properties
index d02938b70c..dc6c310269 100644
--- a/integration-tests/main-xml-io/src/main/resources/application.properties
+++ b/integration-tests/main-xml-io/src/main/resources/application.properties
@@ -18,6 +18,7 @@
#
# Quarkus
#
+quarkus.native.add-all-charsets = true
#
# Camel
@@ -28,4 +29,4 @@ camel.rest.component = platform-http
#
# Main
#
-camel.main.routes-include-pattern =
routes/my-routes.xml,classpath:rests/my-rests.xml,classpath:templates/my-templates.xml,classpath:routes/my-templated.xml
+camel.main.routes-include-pattern =
routes/my-routes.xml,routes/my-routes-iso_8859_15.xml,classpath:rests/my-rests.xml,classpath:templates/my-templates.xml,classpath:routes/my-templated.xml
diff --git
a/integration-tests/main-xml-io/src/main/resources/routes/my-routes-iso_8859_15.xml
b/integration-tests/main-xml-io/src/main/resources/routes/my-routes-iso_8859_15.xml
new file mode 100644
index 0000000000..cf4e0adc9a
--- /dev/null
+++
b/integration-tests/main-xml-io/src/main/resources/routes/my-routes-iso_8859_15.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="ISO-8859-15"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://camel.apache.org/schema/spring"
+ xmlns:foo="http://camel.apache.org/foo"
+ xsi:schemaLocation="
+ http://camel.apache.org/schema/spring
+ http://camel.apache.org/schema/spring/camel-spring.xsd">
+
+ <route id="iso_8859_15-encoded-route">
+ <from uri="direct:iso_8859_15-encoded"/>
+ <setBody>
+ <constant>Hello World from ISO-8859-15 encoded route containing �
symbol !</constant>
+ </setBody>
+ </route>
+
+</routes>
diff --git
a/integration-tests/main-xml-io/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoTest.java
b/integration-tests/main-xml-io/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoTest.java
index ad106c0b56..4c1189adb5 100644
---
a/integration-tests/main-xml-io/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoTest.java
+++
b/integration-tests/main-xml-io/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoTest.java
@@ -97,4 +97,15 @@ public class CoreMainXmlIoTest {
}
+ @Test
+ public void routeEncodedInIso8859_15_ShouldSucceed() {
+ RestAssured.given()
+ .contentType(ContentType.TEXT)
+ .body("in")
+ .post("/xml-io/route/iso_8859_15-encoded")
+ .then()
+ .statusCode(200)
+ .body(Matchers.is("Hello World from ISO-8859-15 encoded route
containing € symbol !"));
+ }
+
}