UTF8, UTF-8, utf8, Utf8 encoding bluesHi All,
I'm reading loads, and loads of very confusing and contradicting information
about UTF8 in Perl. A lot of posts are also (rightfully IMHO) stating that
UTF8 is an absolute nightmare in Perl.
Can someone shed some light as to what is going on here please:
use Encoding;
SysLog("debug", "1 - DEBUG LENGTH: " . length($Response));
my $unicode_chars = Encode::decode('utf8', $Response);
SysLog("debug", "** ENCODING: " . find_encoding($Response));
my $newunicode_chars = substr($unicode_chars, 0, -3);
my $Body = $newunicode...
Converting UTF8 data to UCS2 [Resolved]
Hi.
I am currently translating a database into several languages using Unicode on SQL Server 2000. The field types being populated are nvarchars. Originally I used a program to drive windows to repeatedly access Babelfish, grab the translated text and write that text to a UTF-8 encoded text file. Opening this file in notepad as UTF-8, and then saving as 'Unicode' allows the data to be imported quite happily into the database. In this way, I have successfully translated over a 1000 different screen texts and help screens.
I am now writing a maintenance program to keep the various texts updated and I can successfully get the translated text in UTF-8 format, however, no matter what I try, I cannot get this text into SQL Server since I appear not to be using the correct character conversion.
SQL Server nvarchars use UCS-2 as their character set which apparently is a little endian restricted version of UTF16. Apparently the 'Unicode' property of system.text.encoding generates UCS-2 characters however, it appears that the way I'm doing it is lacking in some respect.
The code I have is as follows:
Sub B02_Click(sender As Object, e As EventArgs) '* Const CP_UTF8 As Integer = 65001 Dim UpdList &...
Convert Gridview Data in to PDf file. or Convert report data in pdf file
Hi have problem to convert Gridview data into PDF file..let me know is there any solution or open source components..Regards Rambhopal Reddy EPlease remember to click “Mark as Answer” on the post that helps you, and to click “Unmark asAnswer” if a marked post does not actually answer your question.
Friend, Check this thread for soultions
http://forums.asp.net/t/1164793.aspx
and then to
http://www.aspnetworld.com/articles/2004011801.aspx
Good luck!
Please Don't forget to click "Mark as Answer" on the post that helped you.This can be benef...
Reading any file and converting the encoding to UTF8Hi,
i want to read a file using TStream (or any like this) class using cbuilder 2009.
i want to use generic approach that means whatever the file is ansi coded or unicode, i want to read it with the same function.
when i look at the help of RAD Studio 2009, i saw C++ Examples for TEncoding...
here is that code (adapted for me)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TEncoding *EncodingArray[6];
EncodingArray[0] = TEncoding::UTF8;
Encodin...
getting an Base64 encoded attribute from ldapHello,
I am having a problem getting a base64 encoded attribute from an ldap
server.=20
When I am doing an ldapsearch from a unix commandline I get the =
attribute
correctly:
QWxhZGRpbjpvcGVuIHNlc2FtZQ=3D=3D
decoding ( decode_base64($encoded) ) it gives me the rigt content
Carlsson Bil =C2erebro AB
When getting it from Ldap using Net::Ldap I get unencryted somthing like
this=20
Carlsson Bil =C2=99erebro=20
I have read nearly everything a could find but didn't anything how to
extract the attribute correctly as a base64 as which it is saved in the
ldap directo...
Net::LDAP::LDIF and UTF8 dataHi!
Since attribute values should be UTF-8 encoded, shouldn't Net::LDIF
convert values that are "character-strings" explicitly to UTF8?
--- LDIF.pm.orig 2004-07-29 15:45:25.000000000 +0200
+++ LDIF.pm 2004-07-29 15:44:54.000000000 +0200
@@ -296,7 +296,9 @@
my $ln = $lower ? lc $attr : $attr;
if ($v =~ /(^[ :]|[\x00-\x1f\x7f-\xff])/) {
require MIME::Base64;
- $ln .= ":: " . MIME::Base64::encode($v,"");
+ use Encode;
+ $ln .= ":: " .MIME::Base64::encode(
+ Encode::is_utf8($v)? encode...
utf8::upgrade,utf8::encode and utf8::is_utf8 on EBCDIC platformHi,
This are the tetstcase i'm runing on EBCDIC platform,
my $b = chr(0x0FF);
$p=utf8::upgrade($b);
print "\n$p";
utf8::upgarde returns the number of octets necessary
to represent the string as UTF-X.
EBCDIC output is 1 whereas ASCII platform output is 2.
Is the return value i'm getting on EBCDIC is correct?
my $c=chr(0x0FF);
print "before $c\n";
print "\n";
utf8::encode($c);
print "after $c\n";
print length($c);
On ASCII before is single octet repsentation and after
encode is two byte , length is 2.
On EBCDIC it...
charset/base64 encoding/encode.Still futzing around with email and character sets.
Under Encode and perluniintro there's mention of
octet \x{..} (255 chars up to \xff
string some internal representation
code point \x{...} 1, 2 or more bytes of data
But I'm not sure about the order of things.
So I'll try this:
I have a MIME messsage part like the following:
Content-Type: text/plain;
charset="BIG5"
Content-Transfer-Encoding: base64
1eLKx9K7t+JIVE1MuPHKvdDFvP6joQ0KCqFYoVihWKFYoVihWKFYoVihWKFYoVihWKFYoVihWKFY
oVihWKFYoVihWKFYoVihWKFYoVihWKFYoVihWAqhaapgt06haqRX...
data, data, data
Hello, I need some advice on the best method to keep a database updated in this scenario. I have a local Solomon SQL Server where we keep our inventory. I want to build an application that will be hosted at a remote hosting location which provides a SQL database. I want to build the application to allow clients to access the inventory items and make requests based on the remote SQL data. The order will be sent to our fulfillment department via email; they will fiill the request and ship. I'm not sure the method to do this while keeping the data current on the remote and the l...
Base64 data: URLs vs url encodingHi,
print URI->new('data:;base64,QmpvZXJu')->data;
print URI->new('data:;base64,%51%6D%70%76%5A%58%4A%75')->data;
I think this should both print "Bjoern", but in the second case the
module returns garbage (URI 1.35).
regards,
--
Bj�rn H�hrmann � mailto:bjoern@hoehrmann.de � http://bjoern.hoehrmann.de
Weinh. Str. 22 � Telefon: +49(0)621/4309674 � http://www.bjoernsworld.de
68309 Mannheim � PGP Pub. KeyID: 0xA4357E78 � http://www.websitedev.de/
Bjoern Hoehrmann <derhoermi@gmx.net> writes:
> Hi,
>
> print URI->...
(Net::LDAP) Automatically convert attributes into utf8 when writtingHi, we are using an old version of Net::LDAP (0.39) in an old perl
installation (5.10.1). Recently we have changed the ldap server, and now it
uses utf8 in the entry attributes, so we are getting problems with reading and
writting attributes with Net::LDAP.
To solve it, I have read the documentation of Net::LDAP 0.39 ( at
https://metacpan.org/pod/release/GBARR/perl-ldap-0.39/lib/Net/LDAP.pod ), and
I see there is an option ("raw") in the constructor to indicate attributes
that should be treated as utf8. I have tested it, and it works por reading
from the ldap server (attr...
convert data from xml to UTF-16 encoded string
Hi,
How i can convert string from xml parameter to UTF-16 encoded string?
For example: I response string as "0x0009" and want convert it to "New line" or "0x000A" to horizontal tab.
I attempt using Char.ConvertFromUtf32 but before i must convert "0x0009" to int...it is don't work.
Help!
Hi _bitblock ,
_bitblock:I attempt using Char.ConvertFromUtf32 but before i must convert "0x0009" to int...it is don't work.
Try :
int test = Convert.ToInt32("0x0009", 16);
Samu ZhangMicrosoft Onlin...
(Net::LDAP) Automatically convert attributes into utf8 when writting #2Hi, we are using an old version of Net::LDAP (0.39) in an old perl
installation (5.10.1). Recently we have changed the ldap server, and now it
uses utf8 in the entry attributes, so we are getting problems with reading and
writting attributes with Net::LDAP.
To solve it, I have read the documentation of Net::LDAP 0.39 ( at
https://metacpan.org/pod/release/GBARR/perl-ldap-0.39/lib/Net/LDAP.pod ), and
I see there is an option ("raw") in the constructor to indicate attributes
that should be treated as utf8. I have tested it, and it works por reading
from the ldap server (attr...
How to convert varchar data type into datetime data type without data lose
Hi all,
i have stored date as varchar(30) data type and Date format is dd/MM/yyyy now i have to convert it into datatime data type can u help me in query ?
i have 330 records and each recod contain the Date in format of dd/MM/YYYY but due to varchar data type i can not perform calculation on Date so i have to convert into datetime without data lose.
please help me in this regard.
Best RegardsRameezWaheed
life is name of learning!Mark as an answer if it helps
You can check these posts
http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=2039108&SiteID=17
...
How to convert a TMemoryStream into an Base64 encoded string in DelphiXE3 and vice verse?How to convert a TMemoryStream into an Base64 encoded string in DelphiXE3
and vice verse?
I know JCLMime.pas, but it works only from Stream to Stream or from
ANSISTRING to ANSISTRING.
Mathias Pannier wrote:
> How to convert a TMemoryStream into an Base64 encoded string in
> DelphiXE3 and vice verse?
>
> I know JCLMime.pas, but it works only from Stream to Stream or from
> ANSISTRING to ANSISTRING.
The built in functions do the same. Stream to stream or string to
string.
I would do it in two steps. 1) Encode the stream and 2) read from the
destination stream into a string.
--
Regards,
Bruce McGee
Glooscap Software
> {quote:title=Mathias Pannier wrote:}{quote}
> How to convert a TMemoryStream into an Base64 encoded string in DelphiXE3
> and vice verse?
>
> I know JCLMime.pas, but it works only from Stream to Stream or from
> ANSISTRING to ANSISTRING.
Hi,
Something like this ?
{code}
uses encdDecd;
{$R *.dfm}
procedure TForm19.Button1Click(Sender: TObject);
var MyString : String;
a : TStringStream;
b : TStringStream;
begin
a := TStringStream.Create;
b := TStringStream.Create;
a.WriteString('Hello World');
a.Position := 0;
b.Clear;
EncodeStream(a,b);
ShowMessage('base64 Encoded : ['+b.DataString+']');
a.Clear;
b.Position := 0;
DecodeStream(b,a);
ShowMessage('base64 Decoded : ['+a.DataString+']'...
NET::LDAP, somewhere the new userPassword gets base64 encodedI'am using the Perl Net::LDAP Module with openldap-2.3.24 (uses LDAP
protocol Version 3).
I need to update the userPassword field, the problem is that somewhere in
the middle the new password i'am giving gets base64 encoded.
As to my understanding i'am preparing the whole password.
In the password i'am putting first the encoding type: {MD5}, {SSHA}, etc and
then the hash. No matter what i do, even the supposed encoding type gets
base64 encoded once in the Server.
I'am not sure if it is Net::LDAP or the server itself who is doing this:
I've tried ...
"use encoding 'utf8'" breaks Net::LDAPGraham Barr wrote:
> I find this very odd. The encoding pragma is not supposed to change how
> perl treats anything other than the sctual script in the file that the
> pragma is in. It allows you to write in any encoding and perl will
> translate that to utf8 when it parses the script.
>
> Maybe the pragma is doingmore than it should
Oh no!
"encoding" pragma does much more than just indicating the encoding of a
script. Here is the quote:
The encoding pragma also modifies the filehandle layers of STDIN and
STDOUT to the specified encoding.
By de...
Convert data source to Data view
In my aspx page I populate the gridview control using OleDbDataReader. And in GridView1_RowCreated, I try to assign the datasource to a dataview, but it gives me an error "Unable to cast object of type 'System.Data.OleDb.OleDbDataReader' to type 'System.Data.DataView'."
Here is the code
<code>Sub displayitems() Dim strSQL As String Try strSQL = "Select ItemId,Description1 + '<BR>' + Description2 + '<BR>' + Description3 ...
Convert Tabular data to Columnar data...
Do you know if there are any classes in the .NET framework that help you convert from tabular data to columnar data....crosstab something?You learn from experience, everything else is just information.
you mean 1 2 3 (in first line) 4 5 6 (in second line) to be converted to 1 2 3 4 5 6 like this?Narasimha"Mark as Answer" the post which helped you in solving your problem
Hi,
If the desciption from bnarasimha is what you need, you can follow the below codes.
Code Behind: private void tabularTocolumnar()
{
HtmlTable tb = table1;
int rowscount = table1.R...
Fwd: "use encoding 'utf8'" breaks Net::LDAP::RootDSEAlexandre Jousset wrote:
> I wrote a small test app like this:
> -------------------------------------------------------
> #!/usr/bin/perl -w
>
> use strict;
> use utf8;
> use encoding 'utf8';
>
> use Net::LDAP;
>
> my $ldap = Net::LDAP->new('localhost', version => 3);
>
> unless ($ldap) {
> die "Could not connect to localhost: $@";
> }
>
> my ($dn, $passwd) = ('cn=admin,dc=exemple,dc=com', 'mypass');
>
> my $mesg = $ldap->bind(dn => $dn, password =&g...
[Fwd: "use encoding 'utf8'" breaks Net::LDAP::RootDSE]Hi,
I hard a hard time tracking this error down, but it seems the two lines in
my code broke my LDAP CGI script:
use utf8;
use encoding 'utf8';
Example to demonstrate:
# perl -wd -e 'use encoding "utf8";use Net::LDAP; use Net::LDAP::RootDSE'
Loading DB routines from perl5db.pl version 1.27
Editor support available.
Enter h or `h h' for help, or `man perldebug' for more help.
Debugged program terminated. Use q to quit or R to restart,
use O inhibit_exit to avoid stopping after program termination,
h q, h R or h O to get additiona...
How to convert a decimal data to binary data in PBHow to convert a decimal data to binary data in PB?
Thanks
Joe
...
Encoding into ASCII text using base64 encoding
how can i use asp.net to encoding a fle into ASCII text using base64 encoding.
byte[] buffer = System.Text.ASCIIEncoding.ASCII.GetBytes( "Your string here" );string stuff = System.Convert.ToBase64String( buffer ); Darrell Norton, MVPDarrell Norton's BlogPlease mark this post as answered if it helped you!...
? should interpolating a utf8-encoded string preserve utf8ness?Consider
my $s = 's';
utf8::upgrade($s);
my $b = ":$s:";
$b isn't in utf8. Should it? I suppose one can argue that it shouldn't
matter externally.
karl williamson wrote:
>Subject: ? should interpolating a utf8-encoded string preserve utf8ness?
Interpolation should have the freedom to do whatever is more convenient.
If the programmer cares about the ultimate encoding of the string,
ey should explicitly upgrade or downgrade the resulting string.
-zefram
On Mon, Dec 13, 2010 at 10:24:25AM -0700, karl williamson wrote:
> Consider
>
>...