Spire.Barcode is a professional barcode library specially designed for .NET developers (C#, VB.NET, ASP.NET, .NET Core) and Java developers (J2SE and J2EE) to generate, read and scan 1D & 2D barcodes.

Wed Nov 27, 2013 10:08 am

Hi,

How can I generate a 2D barcode as a image in the UTF-8 encoding ? If you have any suggestions, please give me response.

Tony

tony_ck_chan
 
Posts: 8
Joined: Tue Nov 12, 2013 10:54 am

Thu Nov 28, 2013 9:58 am

Hello Tony,

Thanks for your inquiry.
Sorry that we don't understand what you mean, do you want to generate the 2D barcode with the UTF-8 encoding, or convert the code generated the 2D barcode to UTF-8 encoding?
Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Thu Nov 28, 2013 11:03 am

Hi Gary,

Thank you very much for your response.

I am sorry that I make you not to understand my question. I think I should tell you this problem in detal.

I tried to generate a 2D barcode containing Chinese characters but the Chinese characters could not be scanned by CIPHERLAB 1564 2D Wireless Memory Scanner. Therefore, I asked my hardware supplier about this problem and then he told me that I need to generate the 2D barcode with the UTF-8 encoding. For your reference, I am using Visual Basic.NET 2005 to develop my application.

Thanks.

Tony

tony_ck_chan
 
Posts: 8
Joined: Tue Nov 12, 2013 10:54 am

Fri Nov 29, 2013 8:26 am

Hello,

Thanks for your information.
You could firstly convert the Chinese characters to UTF-8 encoding, then try the following method,
Code: Select all
 BarcodeSettings settings = new BarcodeSettings();
settings.Type = BarCodeType.Pdf417;
string barcodeText ="your utf-8 encoding string";
settings.Data2D =barcodeText  ;
settings.Data = barcodeText;
BarCodeGenerator generator = new BarCodeGenerator(settings);
Image barcode = generator.GenerateImage();
barcode.Save("test.png");

Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Thu Dec 05, 2013 12:20 pm

Hi Gary,

According to your suggestion, I use the following method to generate the 2D barcode but the Chinese characters can't still be scanned by QuickMark installed on my SmartPhone:

Code: Select all
Dim c2DBarCode As String = "123測試"

'Convert from BIG5 to UTF8                           
Dim b() As Byte = System.Text.Encoding.GetEncoding(950).GetBytes(c2DBarCode)
Dim c() As Byte = System.Text.Encoding.Convert(System.Text.Encoding.GetEncoding(950), System.Text.Encoding.UTF8, b)
c2DBarCode = System.Text.Encoding.UTF8.GetString(c)

Dim cSettings As New BarcodeSettings
cSettings.Data2D = c2DBarCode
cSettings.Data = c2DBarCode
cSettings.Type = CType(System.Enum.Parse(GetType(BarCodeType), "QRCode"), BarCodeType)
cSettings.HasBorder = False
cSettings.TextFont = New Font("PMingLiU", 8, FontStyle.Bold)
cSettings.BarHeight = 15
cSettings.ShowText = False
cSettings.ShowCheckSumChar = False
cSettings.ForeColor = Color.Black

'generate the barcode use the settings
Dim oGenerator As New BarCodeGenerator(cSettings)
Dim imgBarcode As Image = oGenerator.GenerateImage                       
imgBarcode.Save("d:\Download\Test.png")



What should I modify to generate the 2D barcode which can be scanned ?

Thanks.

Tony

tony_ck_chan
 
Posts: 8
Joined: Tue Nov 12, 2013 10:54 am

Fri Dec 06, 2013 6:02 am

Hello Tony,

Thanks for your feedback.
We have reproduced the issue you experienced, which has been transferred to our Dev team, once there are any progress from them, we will inform you immediately.
If there are any questions, welcome to get it back to us.
Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Fri Dec 06, 2013 7:32 am

Hi Gary,

Thank you very much for your response and help.

Tony

tony_ck_chan
 
Posts: 8
Joined: Tue Nov 12, 2013 10:54 am

Mon Dec 30, 2013 2:03 pm

Hi Gary,

How about the further status ?

Thank you very much for your help.

Tony

tony_ck_chan
 
Posts: 8
Joined: Tue Nov 12, 2013 10:54 am

Tue Dec 31, 2013 1:51 am

Hi Tony,

Sorry for inconvenience. Our Dev team is working on some urgent issues of our purcharsed customer, once there are any progress from them, we will inform you immediately.

If there are any questions, welcome to get it back to us.

Thanks And Regards,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Thu Jan 02, 2014 12:06 pm

Hi Gary,

Thank you for your response.

Tony

tony_ck_chan
 
Posts: 8
Joined: Tue Nov 12, 2013 10:54 am

Return to Spire.BarCode