473,608 Members | 1,809 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Issue with Base64Encoding for Unicode Data

33 New Member
Hi All,

Currently we are facing an issue while decoding the Base64Encoded unicode data.

Here is the scenario

We have one custom javascript function that encodes the unicode data using Base64 mechanism. After encoding the data on client side we are sending it back to the server. On Server side we are decoding this unicode data using microsoft framework inbuild functions as below
Expand|Select|Wrap|Line Numbers
  1. Private Function DecodeVarHash(ByVal strEncoded As String) As string      
  2. Dim strDecoded As String = ""
  3. If strEncoded <> "" Then
  4. Dim enc As New System.Text.UTF8Encoding
  5. Try
  6. Dim Buffer As Byte() = Convert.FromBase64String(strEncoded)                        
  7. strDecoded = enc.GetString(Buffer)
  8. Catch ex As Exception
  9. End Try
  10. End If
  11.  
  12.  Return strDecoded
  13.  
  14. End function
  15.  
But when we decode the unicode data using above function it return me some garbage data, i.e it is not properly returning me the original unicode data. For english data above function work properly, but for the data like Hindi, Chinese character it is not properly decoding the data.

Can any body help me how to decode the client side unicode data properly on server side?

Regards
Amol Lokhande
Dec 21 '09 #1
0 1285

Sign in to post your reply or Sign up for a free account.

Similar topics

8
5260
by: Bill Eldridge | last post by:
I'm trying to grab a document off the Web and toss it into a MySQL database, but I keep running into the various encoding problems with Unicode (that aren't a problem for me with GB2312, BIG 5, etc.) What I'd like is something as simple as: CREATE TABLE junk (junklet VARCHAR(2500) CHARACTER SET UTF8)); import MySQLdb, re,urllib
3
1786
by: Elie Grouchko | last post by:
Hi All I am submitting a form to IIS 5.0, the CODEPAGE is set to 1252 and the charset is 'iso-8859-1'. I noticed that if I type information in a language different from English I get data from the Request.Form collection in the following Unicode format: 'stגד', i.e English characters unchanged and other characters coded as Unicode characters. If I change the charset to the one that matches the language in which I am typing (without...
0
2578
by: Jonathan | last post by:
I have a unicode database and I basically wish to publish out certain data (via views) from it to a non unicode database. Unfortunately we can not change the type of either of the databases due to the applications which hang off of them. Unicode database details -> (Windows 2K, SQL Server 2K, collation = Latin1_General_BIN). Non Unicode database details -> (Windows 2K, SQL Server 2K, collation = SQL_Latin1_General_CP1_CI_AS).
0
1466
by: timothy ma and constance lee | last post by:
Sirs/madam I am going to get the base64encoding image. However, what is the xsd type for base64encoding image I am using xml 1.0 only
4
6054
by: webdev | last post by:
lo all, some of the questions i'll ask below have most certainly been discussed already, i just hope someone's kind enough to answer them again to help me out.. so i started a python 2.3 script that grabs some web pages from the web, regex parse the data and stores it localy to xml file for further use.. at first i had no problem using python minidom and everything concerning
2
12094
by: Mark Anderson | last post by:
Hi, I've a problem with code that should produce a Windows(ANSI) encoded text file but doesn't. Server is IIS 5 on Win 2k, with ASP ver? My ASP uses data from an upstream HTML form on a UTF-8 encoded page. The latter is output by a server-side system and I can't alter that source format. Here's some of the ASP code (may wrap): ' Following vars are longer strings but of this type - just more Request
2
2697
by: john | last post by:
Hello, We have a tablet pc that is trying to sync data to our main sql server during the night but we keep getting a timeout issue. The tablet pc has an access database that contains about 5000 rows of data. We have setup the machine.config for a executionTimeout of 900. Below is our code for the specific vb.net app and the webservice it uses. Can someone see if I am missing something as to why this is bombing out? Also is there a
4
3869
by: candide_sh | last post by:
Hello, I created a script with database publishing wizard to convert a SS2005 db into a SS2k db. The script has schema and data and looks very good. When I try to start the created script in SS2k-Query analyzer, I get an error like (in german) Server: Nachr.-Nr. 105, Schweregrad 15, Status 1, Zeile 2 Öffnendes Anführungszeichen vor der Zeichenfolge '䝘퉊䘒 '.
10
1410
by: Samuel | last post by:
Hi I am trying to read text files that are saved in ANSI format with Unicode characters such as French e German big S etc, and as I read the file these characters appear as squares etc. I know that if the file would be saved as Unicode this wouldn't be a problem. The question is whether there is an option that when I create the Stream
0
8069
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8011
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8503
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8488
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8160
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
3972
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4036
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1339
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.