• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

synchronizing criteriaFind() & UTF encoding

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I've the following question :
1. I'm wondering whether the criteriaFind() method needs to be synchronized, since this is also called by various clients simultaneously !
2. While changing the methods in Data Class to remove deprecated methods, I need some clarification on using System default for Character encoding and UTF8 or UTF16.
Thanks in advance.
- Ravi.
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
utf8
 
Ravikiran Choppalli
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yau,
Thanks for the suggestion. But I need clarification why to use that only !
Thanks,
- Ravi.
 
KH Yau
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know! It worked - that's all!
 
KH Yau
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok - i do notice smthg from the deprecated method which led to the decision to use UTF8 instead of 16. The deprecated method has an input argument 0 for "hiint" (check the api). I interpreted it as discarding the high-byte of the unicode. So only 8-bit is used, i.e. UTF8 - hope this help!
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there really anything wrong with using the default character encoding?
Anyone?
Conor
 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the same question as Conor. I've just started on my SCJD, and I replaced the deprecated methods with the ones that use default encoding, and it seemed to work. Is there something I'm missing?
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Correct me if I'm wrong, but it shouldn't matter. Only
the least significant byte is used anyway to write to the
file. So UTF-16 should not be used by the caller, else
the data will end up screwed up - which I pointed out
in one of the threads as a deficiency of the provided code.
The "intern" who wrote it advertized public methods as
accepting Strings, although behind the scenes he uses
bytes. So, I'd say, pointing this out in the docs
shouldn't hurt (I am going to do that), and then it
doesn't really matter... Unless you want to rewrite
DataInfo and FieldInfo to only accept UTF-8 values
(which the "intern" should have done), and not use
Strings in Data at all - just use DataInfo and FieldInfo.
Which is what he or she should have done as well.
 
I'm so happy! And I wish to make this tiny ad happy too:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic