Solved

Doubt about Charset Firebird

Posted on 2014-03-22
9
401 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
  • 5
  • 4
9 Comments
 
LVL 34

Expert Comment

by:Dan Craciun
Comment Utility
UTF-8 should work.

HTH,
Dan
0
 
LVL 1

Author Comment

by:hidrau
Comment Utility
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 34

Accepted Solution

by:
Dan Craciun earned 500 total points
Comment Utility
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
 
LVL 1

Author Comment

by:hidrau
Comment Utility
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 34

Expert Comment

by:Dan Craciun
Comment Utility
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
Comment Utility
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 34

Expert Comment

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

Author Comment

by:hidrau
Comment Utility
Ok Dan.

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

Expert Comment

by:Dan Craciun
Comment Utility
Glad I could help!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now