[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Doubt about Charset Firebird

Posted on 2014-03-22
9
Medium Priority
?
425 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 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 2000 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
In this article, we’ll look at how to deploy ProxySQL.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

872 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