Is possible to use UTF8 in memory database on Windows OS?

1,267 views
Skip to first unread message

GardellaJP

unread,
Jun 28, 2012, 9:38:00 PM6/28/12
to H2 Database
Hi,

I has an application that in dev enviroment some members use Widnows
and when generate database we put some characters like "térmico", but
in the browser it shows "térmico". This doesn't happen on Linux. I
suppose that memory database use CP1252.

I try http://stackoverflow.com/questions/361975/setting-the-default-java-character-encoding,
but doesn't work. Is possible to configure to use UTF-8 in windows?

Cheers,
Juan

Christoph Läubrich

unread,
Jun 29, 2012, 8:17:47 AM6/29/12
to h2-da...@googlegroups.com
Fileencoding has nothing to do with database. If you having Problems in
the browser it is most likeley a problem of wron encoding information in
header and or html file.
see http://en.wikipedia.org/wiki/Character_encodings_in_HTML

Am 29.06.2012 03:38, schrieb GardellaJP:
> Hi,
>
> I has an application that in dev enviroment some members use Widnows
> and when generate database we put some characters like "t�rmico", but
> in the browser it shows "térmico". This doesn't happen on Linux. I

Juan Pablo Gardella

unread,
Jun 29, 2012, 9:14:59 AM6/29/12
to h2-da...@googlegroups.com
Thanks Christoph, but I'm sure that in the page I use UTF-8, I have this:

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

But this problem doesn't happen on Linux, so I suppose that on memory database use cp1252 to store data.

Juan



 

2012/6/29 Christoph Läubrich <lae...@googlemail.com>
Fileencoding has nothing to do with database. If you having Problems in the browser it is most likeley a problem of wron encoding information in header and or html file.
see http://en.wikipedia.org/wiki/Character_encodings_in_HTML

Am 29.06.2012 03:38, schrieb GardellaJP:
Hi,

I has an application that in dev enviroment some members use Widnows
and when generate database we put some characters like "térmico", but
in the browser it shows "térmico". This doesn't happen on Linux. I

suppose that memory database use CP1252.

I try http://stackoverflow.com/questions/361975/setting-the-default-java-character-encoding,
but doesn't work. Is possible to configure to use UTF-8 in windows?

Cheers,
Juan

 

--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To post to this group, send email to h2-da...@googlegroups.com.
To unsubscribe from this group, send email to h2-database+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.


Thomas Mueller

unread,
Jun 29, 2012, 9:26:36 AM6/29/12
to h2-da...@googlegroups.com
Hi,

> I suppose that memory database use CP1252.

No, H2 supports Unicode. I am sure this is not a problem within H2.

> Fileencoding has nothing to do with database.

Yes.

> If you having Problems in the
> browser it is most likeley a problem of wron encoding information in header
> and or html file.

Yes, or in the servlet / web application, or the web server
configuration. I found it's a relatively common problem to get
encoding problems when using web applications.

Regards,
Thomas

Juan Pablo Gardella

unread,
Jun 29, 2012, 9:34:55 AM6/29/12
to h2-da...@googlegroups.com
Ok, thanks Thomas. I don't know how only happen on windows, the html files that are encoding with utf-8 show well, error messages show well, only the data returned by database has this problems. I use hibernate to populate the database, perhaps the problems are there.

Cheers,
Juan

2012/6/29 Thomas Mueller <thomas.to...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To post to this group, send email to h2-da...@googlegroups.com.
To unsubscribe from this group, send email to h2-database...@googlegroups.com.

Thomas Mueller

unread,
Jun 29, 2012, 9:45:20 AM6/29/12
to h2-da...@googlegroups.com
Hi

I don't think the problem is with Hibernate either.

The problem might be how you read files from the file system (before
inserting them into the database). If you use FileInputStream or
similar then you need to specify the encoding (it's not UTF-8 on
Windows).

Regards,
Thomas

Juan Pablo Gardella

unread,
Jun 29, 2012, 9:50:33 AM6/29/12
to h2-da...@googlegroups.com
I use hibernate.hbm2ddl.import_files, so I don't read the files, this tool perhaps read the files and use default encoding when insert data. Perhaps doesn't use file.encoding system parameter, i will investigate this.

Thanks Thomas!



2012/6/29 Thomas Mueller <thomas.to...@gmail.com>
Reply all
Reply to author
Forward
0 new messages