Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vec() and UTF8 strings #1993

Closed
p5pRT opened this issue May 19, 2000 · 3 comments
Closed

vec() and UTF8 strings #1993

p5pRT opened this issue May 19, 2000 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented May 19, 2000

Migrated from rt.perl.org#3267 (status was 'resolved')

Searchable as RT3267$

@p5pRT
Copy link
Author

p5pRT commented May 19, 2000

From mjtg@cus.cam.ac.uk

vec() on UTF8 strings does some odd things, for example

  DB<25> $x = v128.257

  DB<26> vec($x,0,1) = 1

  DB<27> Dump $x
SV = PV(0x2550d0) at 0x223684
  REFCNT = 1
  FLAGS = (POK,pPOK,UTF8)
  PV = 0x244ac8 "\303\200\304\201"\0
  CUR = 4
  LEN = 5

  DB<28> x sprintf "%vd", $x
0 192.257
  DB<29>

But what *should* it do? My best suggestion is that vec() should be
restricted to byte strings only, i.e. should force its argument to bytes
and give an error if any character is > 255.

Mike Guy

(actually near bleeding edge version, despite appearances)
% perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration​:
  Platform​:
  osname=solaris, osvers=2.6, archname=sun4-solaris
  uname=''
  config_args='-dOes -f confug.sh'
  hint=previous, useposix=true, d_sigaction=define
  usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
  useperlio=undef d_sfio=undef uselargefiles=define
  use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler​:
  cc='gcc', optimize='-O', gccversion=2.7.2.3
  cppflags='-I/usr/local/include -I/opt/local/include -DREG_INFTY=22786'
  ccflags ='-I/usr/local/include -I/opt/local/include -DREG_INFTY=22786'
  stdchar='unsigned char', d_stdstdio=define, usevfork=false
  intsize=4, longsize=4, ptrsize=4, doublesize=8
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
  ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
  alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries​:
  ld='gcc', ldflags =' -L/usr/local/lib -L/opt/local/lib'
  libpth=/usr/local/lib /opt/local/lib /lib /usr/lib /usr/ccs/lib
  libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
  libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
  cccdlflags='-fpic', lddlflags='-G -L/usr/local/lib -L/opt/local/lib'

Characteristics of this binary (from libperl)​:
  Compile-time options​: USE_LARGE_FILES
  Built under solaris
  Compiled at May 13 2000 19​:26​:32
  @​INC​:
  /home/mjtg/perl5.6.0x/lib
  /home/mjtg/perl5.6.0x/lib
  /home/mjtg/perl5.6.0x/lib
  /home/mjtg/perl5.6.0x/lib
  .

@p5pRT
Copy link
Author

p5pRT commented May 19, 2000

From [Unknown Contact. See original ticket]

M.J.T. Guy writes​:

vec() on UTF8 strings does some odd things, for example

But what *should* it do? My best suggestion is that vec() should be
restricted to byte strings only, i.e. should force its argument to bytes
and give an error if any character is > 255.

I would not be so severe. Just any character in the specified range...

Ilya

@p5pRT
Copy link
Author

p5pRT commented Dec 20, 2000

From The RT System itself

Well, any character works now...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant