src/PelEntryWindowsString.php
public function setValue($str, $from_exif = false)
    {
        $zlen = strlen(static::ZEROES);
        if (false !== $from_exif) {
            $s = $str;
            if (substr($str, -$zlen, $zlen) == static::ZEROES) {
                $str = substr($str, 0, -$zlen);
            }
            $str = mb_convert_encoding($str, 'UTF-8', 'UCS-2LE');
        } else {
            $s = mb_convert_encoding($str, 'UCS-2LE', 'auto');
        }

        if (substr($s, -$zlen, $zlen) != static::ZEROES) {
            $s .= static::ZEROES;
        }
        $l = strlen($s);

        $this->components = $l;
        $this->str = $str;
        $this->bytes = $s;
    }
public function setValue($str, $from_exif = false)
    {
        $zlen = strlen(static::ZEROES);
        if (false !== $from_exif) {
            $s = $str;
            if (substr($str, -$zlen, $zlen) == static::ZEROES) {
                $str = substr($str, 0, -$zlen);
            }
            $str = mb_convert_encoding($str, 'UTF-8', 'UCS-2LE');
        } else {
            $s = mb_convert_encoding($str, 'UCS-2LE', 'auto');
        }

        if (substr($s, -$zlen, $zlen) != static::ZEROES) {
            $s .= static::ZEROES;
        }
        $l = strlen($s);

        $this->components = $l;
        $this->str = $str;
        $this->bytes = $s;
    }
public function setValue ( $ str , $ from_exif = false ) { $ zlen = strlen ( static :: ZEROES ) ; if ( false !== $ from_exif ) { $ s = $ str ; if ( substr ( $ str , - $ zlen , $ zlen ) == static :: ZEROES ) { $ str = substr ( $ str , 0 , - $ zlen ) ; } $ str = mb_convert_encoding ( $ str , 'UTF-8' , 'UCS-2LE' ) ; } else { $ s = mb_convert_encoding ( $ str , 'UCS-2LE' , 'auto' ) ; } if ( substr ( $ s , - $ zlen , $ zlen ) != static :: ZEROES ) { $ s .= static :: ZEROES ; } $ l = strlen ( $ s ) ; $ this -> components = $ l ; $ this -> str = $ str ; $ this -> bytes = $ s ; }
Give the entry a new value.

This will overwrite the previous value. The value can be
retrieved later with the {@link getValue} method.

@param string $str
the new value of the entry.
@param bool $from_exif
internal use only, tells that string is UCS-2LE encoded, as PHP fails to detect this encoding
Give the entry a new value .