Solved

Doubt about Charset Firebird

Posted on 2014-03-22
9
414 Views
Last Modified: 2014-03-22
Hello Guys,

I am in a terrible doubt. What charset should I use for a field?

I am creating an table where there is a field named "name", this field will keep the
user name, but the user name can be Greeck, Hebrew, Arabic, English, French, Italian, Spanish or portuguese. I am really in doubt what charset I should use to it. Is there any that can handle with all kind of characters?

Help me on this

Thanks
Alexandre
0
Comment
Question by:hidrau
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39947629
UTF-8 should work.

HTH,
Dan
0
 
LVL 1

Author Comment

by:hidrau
ID: 39947638
Hello Dan, thanks for replying me.

so, UTF-8 can keep hebrew, arabic, portuguese, english etc words?

if so, I can have only one field for all these languages that I need to work and I am very glad to know that :)
0
 
LVL 35

Accepted Solution

by:
Dan Craciun earned 500 total points
ID: 39947647
Yes, UTF-8 can represent all Unicode characters. See here: https://en.wikipedia.org/wiki/UTF-8

This does not mean that you can simply insert anything in it and it will work.
Just that if you have UTF-8 encoded text (arabic, hebrew, english etc) you will be able to store it and retrieve it.

If, on the other hand, your text has some other encoding, you'll need to convert it to UTF-8 before inserting in the database.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 1

Author Comment

by:hidrau
ID: 39947665
Ok,

Dan, imagine that I need to insert a name like this " alexandre " that is Portuguese in my name field. as I understood, for each character of that name I'll have 2 bites, now, if I need to insert a hebrew name / word like ¿¿¿¿¿¿¿¿¿¿¿ for each character I will have 4 bites, right?

If so, then for this word ¿¿¿¿¿¿¿¿¿¿¿ that has 5 character I must have a varchar field with 20.

That is an example, because I can have a word with 15 hebrew character.
0
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39947672
Don't know the details in Firebird, but I would assume that for UTF-8 encoding, if you declare varchar(20) it will always have 80 bytes (4 bytes/char).
0
 
LVL 1

Author Comment

by:hidrau
ID: 39947686
hummm,

Let me see whether I got it.

varchar(20) will keep 20 characters, it doesn't mind if it is English, Portuguese, Hebrew or Arabic. It will keep 20 characters and for each character I will have 4 bites using UTF8, am I right Dan?
0
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39947694
Yup, that's about right, AFAIK.
0
 
LVL 1

Author Comment

by:hidrau
ID: 39947700
Ok Dan.

Thanks very much for your help. You helped me a lot to understand it.
0
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39947725
Glad I could help!
0

Featured Post

Webinar: Security & Encryption in the MySQL world

Join Percona’s Solutions Engineer, Dimitri Vanoverbeke as he presents “Security and Encryption in the MySQL world” on Thursday, July 6, 2017 at 7:00 am PDT / 10:00 am EDT (UTC-7).

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
A company’s centralized system that manages user data, security, and distributed resources is often a focus of criminal attention. Active Directory (AD) is no exception. In truth, it’s even more likely to be targeted due to the number of companies …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question