Access field value in template_preprocess_views_view_field function? I have a client with a Drupal 8 site who prefers curly quotes to straight quotes. I have successfully made this change for node titles using a regex replacement in template_preprocess_page_title. Now I am trying to accomplish the same thing for a different text field that is rendered by a view, using template_preprocess_views_view_field or template_preprocess_views_view_fields, but for the life of me I cannot figure out how to get individual field values using this function. Am I even trying the correct preprocess functions?

I have also tried rewriting the output of the field by accessing the variable in a custom twig template, with poor results.
It depends how you have your view set up.

If you have your view using the format 'Fields' then you can override the content with template_preprocess_views_view_field() like you say, like this (although you might want to target individual fields with some if statements):

/**
 * Implements hook_preprocess_HOOK() for views-view-field.html.twig.
 */
function THEMENAME_preprocess_views_view_field(&amp;$variables) {
  $view = $variables['view'];
  $field = $variables['field'];

  if ($view-&gt;id() == 'VIEW_NAME' &amp;&amp; $view-&gt;current_display == 'DISPLAY_NAME') {
    if ($field-&gt;field == 'FIELD_NAME') {
      // Replace characters in the field output.
      $variables['output'] = Drupal\Core\Render\Markup::create(str_replace('find', 'replace', $variables['output']));
    }
  }
}


If you are using the format 'Content' then you could do it at the field template level or node template level instead, since in that case it doesn't use the views field templates.