Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/399.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Genexus中的Java语句_Java_Genexus - Fatal编程技术网

Genexus中的Java语句

Genexus中的Java语句,java,genexus,Java,Genexus,我想在GeneXus中使用以下Java语句,但我不知道GeneXus用于嵌入式Java代码的语法 str = new String(str.getBytes("8859_1"), "UTF-8"); 我怎么做 &str = 'my text' JAVA [!&str!] = new String([!&str!].getBytes("8859_1"), "UTF8"); 它需要如下异常控制。如果没有异常,将出现java.io.UnsupportedEncodingE

我想在GeneXus中使用以下Java语句,但我不知道GeneXus用于嵌入式Java代码的语法

str = new String(str.getBytes("8859_1"), "UTF-8");
我怎么做

&str = 'my text'

JAVA [!&str!] = new String([!&str!].getBytes("8859_1"), "UTF8");

它需要如下异常控制。如果没有异常,将出现java.io.UnsupportedEncodingException错误

&str='text'

JAVA try{[!&str!]=新字符串([!&str!].getBytes(“UTF-8”);}catch(JAVA.io.UnsupportedEncodingException e){}


其中包括爪哇省,该省是“爪哇省”保留区的必要组成部分。如果是一个可变基因/遗传基因的继承人,那么是一个可变基因的海洋可接受基因,是一个可变基因的继承人[!…!] 我想你应该:

java try {
java [!&str!] = new String([!&str!].getBytes("8859_1"), "UTF-8");
java } catch (Exception ex) {
...
java }

您好,Gallotti…,我在Genexus程序中使用并测试了您的java语句。但它有java.io.UnsupportedEncodingException错误。我该怎么办?你能给我一些建议吗?非常感谢你的帮助。UTF8没有“-”现在,我明白了为什么会出现java.io.UnsupportedEncodingException错误。它需要异常控制。谢谢你,Gonzalo.FYI:如果你认为你需要这样做,你可能在达到这一点之前做了一些错误的事情,并且可能已经丢失了数据(取决于你达到这一点的确切方式)。